aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-execfile.js
diff options
context:
space:
mode:
authorBenjamin Gruenbaum <benjamingr@gmail.com>2020-11-28 21:42:34 +0200
committerBenjamin Gruenbaum <benjamingr@gmail.com>2020-12-06 12:23:19 +0200
commit20de5f7efce655d435cfb5ae0811577314fbdeb9 (patch)
tree427088e55248d84bfc726e3d5f65a1d5ab38689d /test/parallel/test-child-process-execfile.js
parent5477969555727fe75fe72417f9a68634ae9eee3c (diff)
downloadios-node-v8-20de5f7efce655d435cfb5ae0811577314fbdeb9.tar.gz
ios-node-v8-20de5f7efce655d435cfb5ae0811577314fbdeb9.tar.bz2
ios-node-v8-20de5f7efce655d435cfb5ae0811577314fbdeb9.zip
child_process: add AbortSignal support
PR-URL: https://github.com/nodejs/node/pull/36308 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.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js
index bc0495b333..3cd4be091c 100644
--- a/test/parallel/test-child-process-execfile.js
+++ b/test/parallel/test-child-process-execfile.js
@@ -7,6 +7,7 @@ const { getSystemErrorName } = require('util');
const fixtures = require('../common/fixtures');
const fixture = fixtures.path('exit.js');
+const echoFixture = fixtures.path('echo.js');
const execOpts = { encoding: 'utf8', shell: true };
{
@@ -45,3 +46,16 @@ const execOpts = { encoding: 'utf8', shell: true };
// Verify the shell option works properly
execFile(process.execPath, [fixture, 0], execOpts, common.mustSucceed());
}
+
+{
+ // Verify that the signal option works properly
+ const ac = new AbortController();
+ const { signal } = ac;
+
+ const callback = common.mustCall((err) => {
+ assert.strictEqual(err.code, 'ABORT_ERR');
+ assert.strictEqual(err.name, 'AbortError');
+ });
+ execFile(process.execPath, [echoFixture, 0], { signal }, callback);
+ ac.abort();
+}