Skip to content

Commit 878f587

Browse files
jeromecovingtonTrott
authored andcommitted
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 4f5be97 commit 878f587

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/parallel/test-child-process-spawn-typeerror.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ const invalidArgValueError =
3333
common.expectsError({ code: 'ERR_INVALID_ARG_VALUE', type: TypeError }, 14);
3434

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

3838
assert.throws(function() {
39-
const child = spawn(invalidcmd, 'this is not an array');
40-
child.on('error', common.mustNotCall());
41-
}, TypeError);
39+
spawn(invalidcmd, 'this is not an array');
40+
}, invalidArgTypeError);
4241

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

0 commit comments

Comments
 (0)