Skip to content

Commit dd705ad

Browse files
shootermvtargos
authored andcommitted
test: increase execFile abort coverage
Verify that if something different than Abortcontroller.signal is passed to child_process.execFile(), ERR_INVALID_ARG_TYPE is thrown. PR-URL: #36429 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent e331de2 commit dd705ad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/parallel/test-child-process-execfile.js

+11
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,14 @@ const execOpts = { encoding: 'utf8', shell: true };
5959
execFile(process.execPath, [echoFixture, 0], { signal }, callback);
6060
ac.abort();
6161
}
62+
63+
{
64+
// Verify that if something different than Abortcontroller.signal
65+
// is passed, ERR_INVALID_ARG_TYPE is thrown
66+
assert.throws(() => {
67+
const callback = common.mustNotCall(() => {});
68+
69+
execFile(process.execPath, [echoFixture, 0], { signal: 'hello' }, callback);
70+
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
71+
72+
}

0 commit comments

Comments
 (0)