diff options
author | Bougarfaoui El houcine <bougarfaoui.el.houcine@gmail.com> | 2017-02-13 16:03:35 -0500 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2017-07-21 06:14:19 -0400 |
commit | a03d8cee1f0cf7a95af01932b5c4356918476e60 (patch) | |
tree | 824a65ac3241663c7e7343f2b76e28b329d15d65 /test | |
parent | d8eb30ac1068664491de0a5a462e3e37163dab45 (diff) | |
download | node-new-a03d8cee1f0cf7a95af01932b5c4356918476e60.tar.gz |
errors: migrate socket_list to internal/errors
PR-URL: https://github.com/nodejs/node/pull/11356
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-internal-socket-list-send.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/parallel/test-internal-socket-list-send.js b/test/parallel/test-internal-socket-list-send.js index 10413bfdbc..797baf43f4 100644 --- a/test/parallel/test-internal-socket-list-send.js +++ b/test/parallel/test-internal-socket-list-send.js @@ -17,7 +17,11 @@ const key = 'test-key'; const list = new SocketListSend(child, 'test'); list._request('msg', 'cmd', common.mustCall((err) => { - assert.strictEqual(err.message, 'child closed before reply'); + common.expectsError({ + code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', + type: Error, + message: 'Child closed before reply received' + })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); } @@ -55,7 +59,11 @@ const key = 'test-key'; const list = new SocketListSend(child, key); list._request('msg', 'cmd', common.mustCall((err) => { - assert.strictEqual(err.message, 'child closed before reply'); + common.expectsError({ + code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', + type: Error, + message: 'Child closed before reply received' + })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); } @@ -119,7 +127,7 @@ const key = 'test-key'; const count = 1; const child = Object.assign(new EventEmitter(), { connected: true, - send: function(msg) { + send: function() { process.nextTick(() => { this.emit('disconnect'); this.emit('internalMessage', { key, count, cmd: 'NODE_SOCKET_COUNT' }); @@ -129,8 +137,12 @@ const key = 'test-key'; const list = new SocketListSend(child, key); - list.getConnections(common.mustCall((err, msg) => { - assert.strictEqual(err.message, 'child closed before reply'); + list.getConnections(common.mustCall((err) => { + common.expectsError({ + code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', + type: Error, + message: 'Child closed before reply received' + })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); } |