Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/parallel/test-child-process-execfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Copy link
Member

@BridgeAR BridgeAR Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a perfect place for assert.ifError.

}));
}
6 changes: 6 additions & 0 deletions test/sequential/test-child-process-execsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -141,3 +142,8 @@ assert.strictEqual(ret, `${msg}\n`);
return true;
});
}

// Verify the shell option works properly
assert.doesNotThrow(() => {
execFileSync(process.execPath, [], execOpts);
});