From ad6d3cfd9933bf3fff471baae2af88a680640c8c Mon Sep 17 00:00:00 2001 From: Denys Otrishko Date: Wed, 19 Jul 2017 17:36:28 +0300 Subject: [PATCH] fixup! lib: emit events about connection messages --- test/node/connection-emit-actions.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/node/connection-emit-actions.js b/test/node/connection-emit-actions.js index 00929e9d..a59e6a30 100644 --- a/test/node/connection-emit-actions.js +++ b/test/node/connection-emit-actions.js @@ -39,6 +39,8 @@ test.afterEach((done) => { test.test('must emit server and client events upon anonymous handshake', (test) => { + test.plan(8); + const client = { application: new jstp.Application('jstp', {}), }; @@ -80,7 +82,6 @@ test.test('must emit server and client events upon anonymous handshake', test.equal(connection.sessionId, app.sessionId, 'session id must be equal to the one provided by authCallback'); connection.close(); - test.end(); }); }); } @@ -88,6 +89,8 @@ test.test('must emit server and client events upon anonymous handshake', test.test('must emit server and client events upon login/password handshake', (test) => { + test.plan(8); + const client = { application: new jstp.Application('jstp', {}), }; @@ -129,7 +132,6 @@ test.test('must emit server and client events upon login/password handshake', test.equal(connection.sessionId, app.sessionId, 'session id must be equal to the one provided by authCallback'); connection.close(); - test.end(); }); }); } @@ -137,6 +139,8 @@ test.test('must emit server and client events upon login/password handshake', test.test('must emit event on call with no arguments and no return value', (test) => { + test.plan(5); + const iface = 'calculator'; const methodName = 'doNothing'; const args = []; @@ -144,7 +148,6 @@ test.test('must emit event on call with no arguments and no return value', connection.on('callback', (error, ok) => { test.assertNot(error, 'callMethod must not return an error'); test.strictSame(ok, [], 'Ok contents must match'); - test.end(); }); connection.callMethod(iface, methodName, args); } @@ -152,6 +155,8 @@ test.test('must emit event on call with no arguments and no return value', test.test('must emit event on call with no arguments and return value', (test) => { + test.plan(5); + const iface = 'calculator'; const methodName = 'answer'; const args = []; @@ -159,7 +164,6 @@ test.test('must emit event on call with no arguments and return value', connection.on('callback', (error, ok) => { test.assertNot(error, 'callMethod must not return an error'); test.strictSame(ok, [42], 'Ok contents must match'); - test.end(); }); connection.callMethod(iface, methodName, args); }