Skip to content

Commit

Permalink
test: rename process.argv[0] to process.execPath, rename ex to err
Browse files Browse the repository at this point in the history
PR-URL: #23488
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bryan English <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
kaltepeter authored and jasnell committed Oct 17, 2018
1 parent 280aed1 commit 3fc8c7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const { execFile } = require('child_process');
// test for leaked global detection
{
const p = fixtures.path('leakedGlobal.js');
execFile(process.argv[0], [p], common.mustCall((ex, stdout, stderr) => {
assert.notStrictEqual(ex.code, 0);
execFile(process.execPath, [p], common.mustCall((err, stdout, stderr) => {
assert.notStrictEqual(err.code, 0);
assert.ok(/\bAssertionError\b.*\bUnexpected global\b.*\bgc\b/.test(stderr));
}));
}
Expand Down Expand Up @@ -85,8 +85,8 @@ const failFixtures = [
];
for (const p of failFixtures) {
const [file, expected] = p;
execFile(process.argv[0], [file], common.mustCall((ex, stdout, stderr) => {
assert.ok(ex);
execFile(process.execPath, [file], common.mustCall((err, stdout, stderr) => {
assert.ok(err);
assert.strictEqual(stderr, '');
const firstLine = stdout.split('\n').shift();
assert.strictEqual(firstLine, expected);
Expand Down

0 comments on commit 3fc8c7a

Please sign in to comment.