diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js index 415489e9db8f65..67bb5924ea73af 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 execOpts = { encoding: 'utf8', shell: true }; { execFile( @@ -39,3 +40,10 @@ const fixture = fixtures.path('exit.js'); child.kill(); child.emit('close', code, null); } + +{ + // Verify the shell option works properly + execFile(process.execPath, [fixture, 0], execOpts, common.mustCall((err) => { + assert.strictEqual(err, null); + })); +} diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index da80e80bce01d2..133217dcdf7c3f 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -29,6 +29,7 @@ const TIMER = 200; const SLEEP = 2000; const start = Date.now(); +const execOpts = { encoding: 'utf8', shell: true }; let err; let caught = false; @@ -141,3 +142,8 @@ assert.strictEqual(ret, `${msg}\n`); return true; }); } + +// Verify the shell option works properly +assert.doesNotThrow(() => { + execFileSync(process.execPath, [], execOpts); +});