Skip to content

Commit 1b97dbd

Browse files
jeromecovingtontargos
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 <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>
1 parent 63778b7 commit 1b97dbd

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)