Skip to content

Commit

Permalink
test: add test on real async method instead of a mock one
Browse files Browse the repository at this point in the history
  • Loading branch information
belochub committed May 15, 2019
1 parent 7d8c0ac commit 595310f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions test/node/application-async-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ const jstp = require('../..');

const app = require('../fixtures/application');

const makeFakeAsyncFn = fn => {
fn[Symbol.toStringTag] = 'AsyncFunction';
return fn;
};

const application = new jstp.Application(app.name, {
someInterface: {
getSessionId: makeFakeAsyncFn(connection =>
Promise.resolve(connection.session.id)
),
sum: makeFakeAsyncFn((connection, a, b) => Promise.resolve(a + b)),
getSessionId: async connection => connection.session.id,
sum: async (connection, a, b) => a + b,
},
});
const server = jstp.net.createServer([application]);
Expand Down

0 comments on commit 595310f

Please sign in to comment.