We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94be10a commit 5d85b05Copy full SHA for 5d85b05
test/parallel/test-child-process-send-type-error.js
@@ -4,10 +4,10 @@ const common = require('../common');
4
const assert = require('assert');
5
const cp = require('child_process');
6
7
-function fail(proc, args) {
+function fail(proc, args, code = 'ERR_INVALID_ARG_TYPE') {
8
assert.throws(() => {
9
proc.send.apply(proc, args);
10
- }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
+ }, { code, name: 'TypeError' });
11
}
12
13
let target = process;
@@ -25,5 +25,6 @@ fail(target, ['msg', null, '']);
25
fail(target, ['msg', null, 'foo']);
26
fail(target, ['msg', null, 0]);
27
fail(target, ['msg', null, NaN]);
28
+fail(target, ['msg', 'meow', undefined], 'ERR_INVALID_HANDLE_TYPE');
29
fail(target, ['msg', null, 1]);
30
fail(target, ['msg', null, null, common.mustNotCall()]);
0 commit comments