| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ if (process.argv[2] === 'child') { | |||
| 8 | 8 | } else { | |
| 9 | 9 | var expected = 'bar'; | |
| 10 | 10 | var child = cp.spawnSync(process.execPath, [__filename, 'child'], { | |
| 11 | - env: {foo: expected} | ||
| 11 | + env: Object.assign(process.env, { foo: expected }) | ||
| 12 | 12 | }); | |
| 13 | 13 | ||
| 14 | 14 | assert.equal(child.stdout.toString().trim(), expected); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ var callbacks = 0; | |||
| 16 | 16 | function test(env, cb) { | |
| 17 | 17 | var filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js'); | |
| 18 | 18 | var execPath = '"' + process.execPath + '" "' + filename + '"'; | |
| 19 | - var options = { env: env || {} }; | ||
| 19 | + var options = { env: Object.assign(process.env, env) }; | ||
| 20 | 20 | exec(execPath, options, function(err, stdout, stderr) { | |
| 21 | 21 | assert(err); | |
| 22 | 22 | assert.equal(stdout, ''); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,12 +53,6 @@ function parent() { | |||
| 53 | 53 | var serverExited = false; | |
| 54 | 54 | var clientExited = false; | |
| 55 | 55 | var serverListened = false; | |
| 56 | - var opt = { | ||
| 57 | - env: { | ||
| 58 | - NODE_DEBUG: 'net', | ||
| 59 | - NODE_COMMON_PORT: process.env.NODE_COMMON_PORT, | ||
| 60 | - } | ||
| 61 | - }; | ||
| 62 | 56 | ||
| 63 | 57 | process.on('exit', function() { | |
| 64 | 58 | assert(serverExited); | |
@@ -75,7 +69,11 @@ function parent() { | |||
| 75 | 69 | }); | |
| 76 | 70 | }, common.platformTimeout(2000)).unref(); | |
| 77 | 71 | ||
| 78 | - var s = spawn(node, [__filename, 'server'], opt); | ||
| 72 | + var s = spawn(node, [__filename, 'server'], { | ||
| 73 | + env: Object.assign(process.env, { | ||
| 74 | + NODE_DEBUG: 'net' | ||
| 75 | + }) | ||
| 76 | + }); | ||
| 79 | 77 | var c; | |
| 80 | 78 | ||
| 81 | 79 | wrap(s.stderr, process.stderr, 'SERVER 2>'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,9 +4,9 @@ var assert = require('assert'); | |||
| 4 | 4 | ||
| 5 | 5 | var spawn = require('child_process').spawn; | |
| 6 | 6 | var child = spawn(process.execPath, [], { | |
| 7 | - env: { | ||
| 7 | + env: Object.assign(process.env, { | ||
| 8 | 8 | NODE_DEBUG: process.argv[2] | |
| 9 | - } | ||
| 9 | + }) | ||
| 10 | 10 | }); | |
| 11 | 11 | var wanted = child.pid + '\n'; | |
| 12 | 12 | var found = ''; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,12 +27,7 @@ function test(environ, shouldWrite) { | |||
| 27 | 27 | ||
| 28 | 28 | var spawn = require('child_process').spawn; | |
| 29 | 29 | var child = spawn(process.execPath, [__filename, 'child'], { | |
| 30 | - // Lttng requires the HOME env variable or it prints to stderr, | ||
| 31 | - // This is not really ideal, as it breaks this test, so the HOME | ||
| 32 | - // env variable is passed to the child to make the test pass. | ||
| 33 | - // this is fixed in the next version of lttng (2.7+), so we can | ||
| 34 | - // remove it at sometime in the future. | ||
| 35 | - env: { NODE_DEBUG: environ, HOME: process.env.HOME } | ||
| 30 | + env: Object.assign(process.env, { NODE_DEBUG: environ }) | ||
| 36 | 31 | }); | |
| 37 | 32 | ||
| 38 | 33 | expectErr = expectErr.split('%PID%').join(child.pid); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments