Skip to content

Commit 69dbcf2

Browse files
committed
cleanup #531
1 parent 0675d34 commit 69dbcf2

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

lib/fork.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var send = require('./send');
99

1010
var env = process.env;
1111

12+
// ensure NODE_PATH paths are absolute
1213
if (process.env.NODE_PATH) {
1314
var nodePath = process.env.NODE_PATH
1415
.split(path.delimiter)
@@ -17,9 +18,7 @@ if (process.env.NODE_PATH) {
1718
})
1819
.join(path.delimiter);
1920

20-
env = objectAssign({
21-
NODE_PATH: nodePath
22-
}, env);
21+
env = objectAssign({NODE_PATH: nodePath}, env);
2322
}
2423

2524
module.exports = function (file, opts) {

test/cli.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ test('watcher works', function (t) {
161161

162162
test('handles NODE_PATH', function (t) {
163163
var nodePaths = 'node-paths/modules' + path.delimiter + 'node-paths/deep/nested';
164+
164165
execCli('fixture/node-paths.js', {env: {NODE_PATH: nodePaths}}, function (err) {
165-
t.notOk(err);
166+
t.ifError(err);
166167
t.end();
167168
});
168169
});

test/fixture/node-paths.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import test from '../../';
2-
32
import foo from 'nested/foo';
43
import bar from 'path/bar';
54

65
test('relative require', t => {
7-
t.is(foo(), 'bar');
8-
t.is(bar(), 'baz');
6+
t.is(foo, 'bar');
7+
t.is(bar, 'baz');
98
});
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
module.exports = function () {
2-
return 'baz';
3-
};
4-
1+
module.exports = 'baz';
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
module.exports = function () {
2-
return 'bar';
3-
};
4-
1+
module.exports = 'bar';

0 commit comments

Comments
 (0)