-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathtest-worker-node-options.js
More file actions
57 lines (52 loc) · 1.04 KB
/
test-worker-node-options.js
File metadata and controls
57 lines (52 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'use strict';
const common = require('../common');
const {
spawnSyncAndExitWithoutError,
spawnSyncAndAssert,
} = require('../common/child_process');
if (process.config.variables.node_without_node_options) {
common.skip('missing NODE_OPTIONS support');
}
const fixtures = require('../common/fixtures');
spawnSyncAndExitWithoutError(
process.execPath,
[
fixtures.path('spawn-worker-with-copied-env'),
],
{
env: {
...process.env,
NODE_OPTIONS: '--title=foo'
}
}
);
spawnSyncAndAssert(
process.execPath,
[
fixtures.path('spawn-worker-with-trace-exit'),
],
{
env: {
...process.env,
}
},
{
stderr: /spawn-worker-with-trace-exit\.js:17/
}
);
// Test that NODE_OPTIONS set at runtime in the parent process are
// picked up by a worker even when the env option is not provided.
spawnSyncAndAssert(
process.execPath,
[
fixtures.path('spawn-worker-without-env-option'),
],
{
env: {
...process.env,
}
},
{
stderr: /spawn-worker-without-env-option\.js:14/
}
);