mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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: https://github.com/nodejs/node/pull/36429 Backport-PR-URL: https://github.com/nodejs/node/pull/38386 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
a5c0f39197
commit
dc63ca686e
1 file changed
+11
@@ -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' });
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user