summaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-spawn-typeerror.js
diff options
context:
space:
mode:
authorJerome Covington <jeromecovington@gmail.com>2018-10-28 13:55:59 -0400
committerRich Trott <rtrott@gmail.com>2018-11-01 20:25:01 -0700
commit878f587783e4b79ac6fd76524e1fd431e8c11e7c (patch)
tree8543559f137dd60ec3d2512bfa39cf6d72c548ff /test/parallel/test-child-process-spawn-typeerror.js
parent4f5be97e8dc40f005b18fc67209cd61abb7bcd71 (diff)
downloadandroid-node-v8-878f587783e4b79ac6fd76524e1fd431e8c11e7c.tar.gz
android-node-v8-878f587783e4b79ac6fd76524e1fd431e8c11e7c.tar.bz2
android-node-v8-878f587783e4b79ac6fd76524e1fd431e8c11e7c.zip
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test/parallel/test-child-process-spawn-typeerror.js')
-rw-r--r--test/parallel/test-child-process-spawn-typeerror.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js
index 31a1867df9..82acaf8e08 100644
--- a/test/parallel/test-child-process-spawn-typeerror.js
+++ b/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);