Beta 7 with some repo names changed.

This commit is contained in:
Luis Fernando Molina committed 2020-11-15 13:05:19 +01:00
1 parent 0f7b40cca7
commit 963c19493a
3408 files changed
+462217 -15516

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
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);
});
});
});