mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
d38503ab01
commit
652782d137
1
test/fixtures/baz.js
vendored
Normal file
1
test/fixtures/baz.js
vendored
Normal file
@ -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');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user