Browse Source

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>
process-exit-stdio-flushing
Myles Borins 9 years ago
committed by Phillip Johnsen
parent
commit
652782d137
  1. 1
      test/fixtures/baz.js
  2. 4
      test/parallel/test-repl-require.js

1
test/fixtures/baz.js

@ -0,0 +1 @@
module.exports = 'perhaps I work';

4
test/parallel/test-repl-require.js

@ -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…
Cancel
Save