Skip to content

Commit

Permalink
test: assert that invalidcmd throws error code
Browse files Browse the repository at this point in the history
Update invalidcmd test case in test-child-process-spawn-typeerror to
assert on specific expected error code.
  • Loading branch information
jeromecovington committed Nov 1, 2018
1 parent 2caf079 commit b55906e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/parallel/test-child-process-spawn-typeerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b55906e

Please sign in to comment.