diff --git a/lib/fork.js b/lib/fork.js index 99fe2be6b..14852677a 100644 --- a/lib/fork.js +++ b/lib/fork.js @@ -18,7 +18,7 @@ if (process.env.NODE_PATH) { }) .join(path.delimiter); - env = objectAssign({NODE_PATH: nodePath}, env); + env = objectAssign(env, {NODE_PATH: nodePath}); } module.exports = function (file, opts) { diff --git a/test/cli.js b/test/cli.js index 426dec5b4..bc7aee191 100644 --- a/test/cli.js +++ b/test/cli.js @@ -160,7 +160,7 @@ test('watcher works', function (t) { }); test('handles NODE_PATH', function (t) { - var nodePaths = 'node-paths/modules' + path.delimiter + 'node-paths/deep/nested'; + var nodePaths = 'fixture/node-paths/modules' + path.delimiter + 'fixture/node-paths/deep/nested'; execCli('fixture/node-paths.js', {env: {NODE_PATH: nodePaths}}, function (err) { t.ifError(err);