|
34 | 34 | // being in the test folder |
35 | 35 | process.chdir(__dirname); |
36 | 36 |
|
37 | | - child.exec(process.execPath + ' test-init', {env: {'TEST_INIT': 1}}, |
| 37 | + // slow but simple |
| 38 | + var envCopy = JSON.parse(JSON.stringify(process.env)); |
| 39 | + envCopy.TEST_INIT = 1; |
| 40 | + |
| 41 | + child.exec(process.execPath + ' test-init', {env: envCopy}, |
38 | 42 | function(err, stdout, stderr) { |
39 | 43 | assert.equal(stdout, 'Loaded successfully!', |
40 | 44 | '`node test-init` failed!'); |
41 | 45 | }); |
42 | | - child.exec(process.execPath + ' test-init.js', {env: {'TEST_INIT': 1}}, |
| 46 | + child.exec(process.execPath + ' test-init.js', {env: envCopy}, |
43 | 47 | function(err, stdout, stderr) { |
44 | 48 | assert.equal(stdout, 'Loaded successfully!', |
45 | 49 | '`node test-init.js` failed!'); |
|
48 | 52 | // test-init-index is in fixtures dir as requested by ry, so go there |
49 | 53 | process.chdir(common.fixturesDir); |
50 | 54 |
|
51 | | - child.exec(process.execPath + ' test-init-index', {env: {'TEST_INIT': 1}}, |
| 55 | + child.exec(process.execPath + ' test-init-index', {env: envCopy}, |
52 | 56 | function(err, stdout, stderr) { |
53 | 57 | assert.equal(stdout, 'Loaded successfully!', |
54 | 58 | '`node test-init-index failed!'); |
|
59 | 63 | // expected in node |
60 | 64 | process.chdir(common.fixturesDir + '/test-init-native/'); |
61 | 65 |
|
62 | | - child.exec(process.execPath + ' fs', {env: {'TEST_INIT': 1}}, |
| 66 | + child.exec(process.execPath + ' fs', {env: envCopy}, |
63 | 67 | function(err, stdout, stderr) { |
64 | 68 | assert.equal(stdout, 'fs loaded successfully', |
65 | 69 | '`node fs` failed!'); |
|
0 commit comments