diff --git a/lib/fork.js b/lib/fork.js index bf918d3913..0ca0f45a49 100644 --- a/lib/fork.js +++ b/lib/fork.js @@ -10,12 +10,10 @@ if (fs.realpathSync(__filename) !== __filename) { console.warn('WARNING: `npm link ava` and the `--preserve-symlink` flag are incompatible. We have detected that AVA is linked via `npm link`, and that you are using either an early version of Node 6, or the `--preserve-symlink` flag. This breaks AVA. You should upgrade to Node 6.2.0+, avoid the `--preserve-symlink` flag, or avoid using `npm link ava`.'); } -let env = process.env; +const env = Object.assign({NODE_ENV: 'test'}, process.env); // Ensure NODE_PATH paths are absolute if (env.NODE_PATH) { - env = Object.assign({}, env); - env.NODE_PATH = env.NODE_PATH .split(path.delimiter) .map(x => path.resolve(x))