| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ const os = require('os'); | |||
| 10 | 10 | ||
| 11 | 11 | const fixture = fixtures.path('exit.js'); | |
| 12 | 12 | const echoFixture = fixtures.path('echo.js'); | |
| 13 | - const execOpts = { encoding: 'utf8', shell: true }; | ||
| 13 | + const execOpts = { encoding: 'utf8', shell: true, env: { ...process.env, NODE: process.execPath, FIXTURE: fixture } }; | ||
| 14 | 14 | ||
| 15 | 15 | { | |
| 16 | 16 | execFile( | |
@@ -46,7 +46,12 @@ const execOpts = { encoding: 'utf8', shell: true }; | |||
| 46 | 46 | ||
| 47 | 47 | { | |
| 48 | 48 | // Verify the shell option works properly | |
| 49 | - execFile(process.execPath, [fixture, 0], execOpts, common.mustSucceed()); | ||
| 49 | + execFile( | ||
| 50 | + `"${common.isWindows ? execOpts.env.NODE : '$NODE'}"`, | ||
| 51 | + [`"${common.isWindows ? execOpts.env.FIXTURE : '$FIXTURE'}"`, 0], | ||
| 52 | + execOpts, | ||
| 53 | + common.mustSucceed(), | ||
| 54 | + ); | ||
| 50 | 55 | } | |
| 51 | 56 | ||
| 52 | 57 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,14 +6,16 @@ if (process.config.variables.node_without_node_options) | |||
| 6 | 6 | // Test options specified by env variable. | |
| 7 | 7 | ||
| 8 | 8 | const assert = require('assert'); | |
| 9 | + const path = require('path'); | ||
| 9 | 10 | const exec = require('child_process').execFile; | |
| 10 | 11 | const { Worker } = require('worker_threads'); | |
| 11 | 12 | ||
| 13 | + const fixtures = require('../common/fixtures'); | ||
| 12 | 14 | const tmpdir = require('../common/tmpdir'); | |
| 13 | 15 | tmpdir.refresh(); | |
| 14 | 16 | ||
| 15 | - const printA = require.resolve('../fixtures/printA.js'); | ||
| 16 | - const printSpaceA = require.resolve('../fixtures/print A.js'); | ||
| 17 | + const printA = path.relative(tmpdir.path, fixtures.path('printA.js')); | ||
| 18 | + const printSpaceA = path.relative(tmpdir.path, fixtures.path('print A.js')); | ||
| 17 | 19 | ||
| 18 | 20 | expectNoWorker(` -r ${printA} `, 'A\nB\n'); | |
| 19 | 21 | expectNoWorker(`-r ${printA}`, 'A\nB\n'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,8 +22,8 @@ const { spawnSync } = require('child_process'); | |||
| 22 | 22 | [ '--use-largepages=xyzzy', '-p', '42' ]); | |
| 23 | 23 | assert.strictEqual(child.status, 9); | |
| 24 | 24 | assert.strictEqual(child.signal, null); | |
| 25 | - assert.strictEqual(child.stderr.toString().match(/\S+/g).slice(1).join(' '), | ||
| 26 | - 'invalid value for --use-largepages'); | ||
| 25 | + assert.match(child.stderr.toString().trim(), | ||
| 26 | + /invalid value for --use-largepages$/); | ||
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | 29 | // TODO(gabrielschulhof): Make assertions about the stderr, which may or may not | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | 3 | require('../common'); | |
| 4 | 4 | const fixtures = require('../common/fixtures'); | |
| 5 | - const { execSync } = require('child_process'); | ||
| 5 | + const { execFileSync } = require('child_process'); | ||
| 6 | 6 | ||
| 7 | - execSync(process.execPath, { | ||
| 7 | + execFileSync(process.execPath, { | ||
| 8 | 8 | encoding: 'utf8', | |
| 9 | 9 | stdio: 'inherit', | |
| 10 | 10 | env: { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments