Skip to content

Commit

Permalink
test: update test-repl-require for local paths
Browse files Browse the repository at this point in the history
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
Myles Borins authored and phillipj committed Mar 29, 2016
1 parent d38503a commit 652782d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/fixtures/baz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'perhaps I work';
4 changes: 2 additions & 2 deletions test/parallel/test-repl-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.