Skip to content

Commit 1f10a7c

Browse files
committed
Stop rewriting NODE_PATH values to be absolute paths
1 parent f217252 commit 1f10a7c

File tree

5 files changed

+1
-32
lines changed

5 files changed

+1
-32
lines changed

lib/fork.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ if (fs.realpathSync(__filename) !== __filename) {
1212
// the presence of this variable allows it to require this one instead
1313
const AVA_PATH = path.resolve(__dirname, '..');
1414

15-
// Ensure NODE_PATH paths are absolute
16-
let NODE_PATH;
17-
18-
if (process.env.NODE_PATH) {
19-
NODE_PATH = process.env.NODE_PATH
20-
.split(path.delimiter)
21-
.map(x => path.resolve(x))
22-
.join(path.delimiter);
23-
}
24-
2515
const describeTTY = tty => ({
2616
colorDepth: tty.getColorDepth ? tty.getColorDepth() : undefined,
2717
hasColors: typeof tty.hasColors === 'function',
@@ -56,7 +46,7 @@ module.exports = (file, opts, execArgv) => {
5646
const subprocess = childProcess.fork(workerPath, args, {
5747
cwd: opts.projectDir,
5848
silent: true,
59-
env: {NODE_ENV: 'test', ...process.env, ...opts.environmentVariables, AVA_PATH, NODE_PATH},
49+
env: {NODE_ENV: 'test', ...process.env, ...opts.environmentVariables, AVA_PATH},
6050
execArgv: execArgv || process.execArgv
6151
});
6252

test/fixture/node-paths.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/fixture/node-paths/deep/nested/the-path/bar.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/fixture/node-paths/modules/nested/foo.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/integration/assorted.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ for (const tapFlag of ['--tap', '-t']) {
5050
});
5151
}
5252

53-
test('handles NODE_PATH', t => {
54-
const nodePaths = `node-paths/modules${path.delimiter}node-paths/deep/nested`;
55-
56-
execCli('node-paths.js', {env: {NODE_PATH: nodePaths}}, err => {
57-
t.ifError(err);
58-
t.end();
59-
});
60-
});
61-
6253
test('works when no files are found', t => {
6354
execCli([], {dirname: 'fixture/globs/no-files'}, (err, stdout) => {
6455
t.is(err.code, 1);

0 commit comments

Comments
 (0)