From b55906e0eee0bdec518bc07ff88dad4218e28a20 Mon Sep 17 00:00:00 2001 From: Jerome Covington Date: Sun, 28 Oct 2018 13:55:59 -0400 Subject: [PATCH] test: assert that invalidcmd throws error code Update invalidcmd test case in test-child-process-spawn-typeerror to assert on specific expected error code. --- test/parallel/test-child-process-spawn-typeerror.js | 7 +++---- 1 file 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 31a1867df945f7..82acaf8e088038 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);