Skip to content
Permalink
Browse files

test: assert that invalidcmd throws error code

Update invalidcmd test case in test-child-process-spawn-typeerror to
assert on specific expected error code.

PR-URL: #23942
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
jeromecovington authored and MylesBorins committed Oct 28, 2018
1 parent 52c9209 commit b3ab546b37fa82118052a7d0adb6f9ca1634b6ba
Showing with 3 additions and 4 deletions.
  1. +3 −4 test/parallel/test-child-process-spawn-typeerror.js
@@ -33,12 +33,11 @@ const invalidArgValueError =
common.expectsError({ code: 'ERR_INVALID_ARG_VALUE', type: TypeError }, 14);

const invalidArgTypeError =
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 12);
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 13);

assert.throws(function() {
const child = spawn(invalidcmd, 'this is not an array');
child.on('error', common.mustNotCall());
}, TypeError);
spawn(invalidcmd, 'this is not an array');
}, invalidArgTypeError);

// Verify that valid argument combinations do not throw.
spawn(cmd);

0 comments on commit b3ab546

Please sign in to comment.
You can’t perform that action at this time.