Skip to content

Commit dc63ca6

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 Backport-PR-URL: #38386 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent a5c0f39 commit dc63ca6

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
@@ -60,3 +60,14 @@ const execOpts = { encoding: 'utf8', shell: true };
6060
execFile(process.execPath, [echoFixture, 0], { signal }, callback);
6161
ac.abort();
6262
}
63+
64+
{
65+
// Verify that if something different than Abortcontroller.signal
66+
// is passed, ERR_INVALID_ARG_TYPE is thrown
67+
assert.throws(() => {
68+
const callback = common.mustNotCall(() => {});
69+
70+
execFile(process.execPath, [echoFixture, 0], { signal: 'hello' }, callback);
71+
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
72+
73+
}

0 commit comments

Comments
 (0)