Skip to content

Commit 652782d

Browse files
Myles Borinsphillipj
Myles Borins
authored andcommitted
test: update test-repl-require for local paths
Currently we are not testing that resolution of local paths is resolved first in the repl. This addition to `test-repl-require` adds an additional fixture an ensures we won't regress in the future PR-URL: #5689 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent d38503a commit 652782d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/fixtures/baz.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'perhaps I work';

test/parallel/test-repl-require.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ server.listen(options, function() {
2323
const conn = net.connect(options);
2424
conn.setEncoding('utf8');
2525
conn.on('data', (data) => answer += data);
26-
conn.write('require("baz")\n.exit\n');
26+
conn.write('require("baz")\nrequire("./baz")\n.exit\n');
2727
});
2828

2929
process.on('exit', function() {
3030
assert.strictEqual(false, /Cannot find module/.test(answer));
3131
assert.strictEqual(false, /Error/.test(answer));
32-
assert.strictEqual(true, /eye catcher/.test(answer));
32+
assert.strictEqual(answer, '\'eye catcher\'\n\'perhaps I work\'\n');
3333
});

0 commit comments

Comments
 (0)