Skip to content
Permalink
Browse files

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 <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information...
MylesBorins authored and phillipj committed Mar 13, 2016
1 parent d38503a commit 652782d1374600ebb0447e2323094ad2c8616823
Showing with 3 additions and 2 deletions.
  1. +1 −0 test/fixtures/baz.js
  2. +2 −2 test/parallel/test-repl-require.js
@@ -0,0 +1 @@
module.exports = 'perhaps I work';
@@ -23,11 +23,11 @@ server.listen(options, function() {
const conn = net.connect(options);
conn.setEncoding('utf8');
conn.on('data', (data) => answer += data);
conn.write('require("baz")\n.exit\n');
conn.write('require("baz")\nrequire("./baz")\n.exit\n');
});

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

0 comments on commit 652782d

Please sign in to comment.
You can’t perform that action at this time.