Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5dd58d0

Browse files
shootermvTrott
authored andcommittedDec 10, 2020
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 <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 8b69724 commit 5dd58d0

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)
Please sign in to comment.