Skip to content

Commit 5d85b05

Browse files
authored
test: improve test coverage for child process message sending
Signed-off-by: Juan José Arboleda <[email protected]> PR-URL: #55710 Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 94be10a commit 5d85b05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/parallel/test-child-process-send-type-error.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const common = require('../common');
44
const assert = require('assert');
55
const cp = require('child_process');
66

7-
function fail(proc, args) {
7+
function fail(proc, args, code = 'ERR_INVALID_ARG_TYPE') {
88
assert.throws(() => {
99
proc.send.apply(proc, args);
10-
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
10+
}, { code, name: 'TypeError' });
1111
}
1212

1313
let target = process;
@@ -25,5 +25,6 @@ fail(target, ['msg', null, '']);
2525
fail(target, ['msg', null, 'foo']);
2626
fail(target, ['msg', null, 0]);
2727
fail(target, ['msg', null, NaN]);
28+
fail(target, ['msg', 'meow', undefined], 'ERR_INVALID_HANDLE_TYPE');
2829
fail(target, ['msg', null, 1]);
2930
fail(target, ['msg', null, null, common.mustNotCall()]);

0 commit comments

Comments
 (0)