Current Folder

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 14:05:59 +01:00
1 parent 8b3382289b
commit cfcada880d
4379 files changed

No files matched your search

-27
View File
@@ -1,27 +0,0 @@
var servify = require("./..");
var assert = require("assert");
describe("Servify", function(){
it("must be able to create a service and call its functions", function(){
// Creates service
var count = 0;
return servify.api(7171, {
square: (x) => x * x,
concat: (a, b) => a.concat(b),
count: () => ++count
}).then(() => {
// Uses service
var lib = servify.at("http://localhost:7171");
return Promise.all([
lib.square(3).then(x => assert.equal(x, 9)),
lib.concat([1,2],[3,4]).then(x => assert.equal(JSON.stringify(x), "[1,2,3,4]")),
lib.count().then(x => assert.equal(JSON.stringify(x), "1"))
]);
}).catch(function(err){
console.log(err);
});
});
});