diff --git a/test/parallel/test-child-process-send-type-error.js b/test/parallel/test-child-process-send-type-error.js index 65c620dd29b..91136cd0317 100644 --- a/test/parallel/test-child-process-send-type-error.js +++ b/test/parallel/test-child-process-send-type-error.js @@ -4,10 +4,10 @@ const common = require('../common'); const assert = require('assert'); const cp = require('child_process'); -function fail(proc, args) { +function fail(proc, args, code = 'ERR_INVALID_ARG_TYPE') { assert.throws(() => { proc.send.apply(proc, args); - }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }); + }, { code, name: 'TypeError' }); } let target = process; @@ -25,5 +25,6 @@ fail(target, ['msg', null, '']); fail(target, ['msg', null, 'foo']); fail(target, ['msg', null, 0]); fail(target, ['msg', null, NaN]); +fail(target, ['msg', 'meow', undefined], 'ERR_INVALID_HANDLE_TYPE'); fail(target, ['msg', null, 1]); fail(target, ['msg', null, null, common.mustNotCall()]);