mirror of https://github.com/nodejs/node.git
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 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>pull/36429/head
parent
8b697246df
commit
5dd58d069f
|
@ -59,3 +59,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' });
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue