8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afc1628 commit c908b8aCopy full SHA for c908b8a
test/parallel/test-child-process-execfile.js
@@ -10,7 +10,7 @@ const os = require('os');
10
11
const fixture = fixtures.path('exit.js');
12
const echoFixture = fixtures.path('echo.js');
13
-const execOpts = { encoding: 'utf8', shell: true };
+const execOpts = { encoding: 'utf8', shell: true, env: { ...process.env, NODE: process.execPath, FIXTURE: fixture } };
14
15
{
16
execFile(
@@ -46,7 +46,12 @@ const execOpts = { encoding: 'utf8', shell: true };
46
47
48
// Verify the shell option works properly
49
- execFile(process.execPath, [fixture, 0], execOpts, common.mustSucceed());
+ execFile(
50
+ `"${common.isWindows ? execOpts.env.NODE : '$NODE'}"`,
51
+ [`"${common.isWindows ? execOpts.env.FIXTURE : '$FIXTURE'}"`, 0],
52
+ execOpts,
53
+ common.mustSucceed(),
54
+ );
55
}
56
57
test/parallel/test-cli-node-options.js
@@ -6,14 +6,16 @@ if (process.config.variables.node_without_node_options)
6
// Test options specified by env variable.
7
8
const assert = require('assert');
9
+const path = require('path');
const exec = require('child_process').execFile;
const { Worker } = require('worker_threads');
+const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
-const printA = require.resolve('../fixtures/printA.js');
-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'));
19
20
expectNoWorker(` -r ${printA} `, 'A\nB\n');
21
expectNoWorker(`-r ${printA}`, 'A\nB\n');
test/parallel/test-startup-large-pages.js
@@ -22,8 +22,8 @@ const { spawnSync } = require('child_process');
22
[ '--use-largepages=xyzzy', '-p', '42' ]);
23
assert.strictEqual(child.status, 9);
24
assert.strictEqual(child.signal, null);
25
- assert.strictEqual(child.stderr.toString().match(/\S+/g).slice(1).join(' '),
26
- 'invalid value for --use-largepages'); 8000 span>
+ assert.match(child.stderr.toString().trim(),
+ /invalid value for --use-largepages$/);
27
28
29
// TODO(gabrielschulhof): Make assertions about the stderr, which may or may not
test/pseudo-tty/test-repl-external-module.js
@@ -2,9 +2,9 @@
2
3
require('../common');
4
const fixtures = require('../common/fixtures');
5
-const { execSync } = require('child_process');
+const { execFileSync } = require('child_process');
-execSync(process.execPath, {
+execFileSync(process.execPath, {
encoding: 'utf8',
stdio: 'inherit',
env: {