summaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-execfile.js
diff options
context:
space:
mode:
authorMoshe vilner <shootermv@gmail.com>2020-12-07 16:01:25 +0200
committerRich Trott <rtrott@gmail.com>2020-12-10 05:36:37 -0800
commit5dd58d069fd31e778d050a2ffc7af8e64af30095 (patch)
tree6c4ecca664a12eee1a15240bc03c8f11c7676095 /test/parallel/test-child-process-execfile.js
parent8b697246dfd0026517ec5ae4271303296b389638 (diff)
downloadios-node-v8-5dd58d069fd31e778d050a2ffc7af8e64af30095.tar.gz
ios-node-v8-5dd58d069fd31e778d050a2ffc7af8e64af30095.tar.bz2
ios-node-v8-5dd58d069fd31e778d050a2ffc7af8e64af30095.zip
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>
Diffstat (limited to 'test/parallel/test-child-process-execfile.js')
-rw-r--r--test/parallel/test-child-process-execfile.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js
index 3cd4be091c..a6345a7e5f 100644
--- a/test/parallel/test-child-process-execfile.js
+++ b/test/parallel/test-child-process-execfile.js
@@ -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' });
+
+}