X Tutup
The Wayback Machine - https://web.archive.org/web/20230218090445/https://github.com/nodejs/node/commit/dc63ca686e
Skip to content
Permalink
Browse files
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 <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
shootermv authored and targos committed Apr 30, 2021
1 parent a5c0f39 commit dc63ca6
Showing 1 changed file with 11 additions and 0 deletions.
@@ -60,3 +60,14 @@ const execOpts = { encoding: 'utf8', shell: true };
execFile(process.execPath, [echoFixture, 0], { signal }, callback);
ac.abort();
}

{
// Verify that if something different than Abortcontroller.signal
// is passed, ERR_INVALID_ARG_TYPE is thrown
assert.throws(() => {
const callback = common.mustNotCall(() => {});

execFile(process.execPath, [echoFixture, 0], { signal: 'hello' }, callback);
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });

}

0 comments on commit dc63ca6

Please sign in to comment.
X Tutup