summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyles Borins <mborins@us.ibm.com>2016-03-13 13:59:33 -0700
committerPhillip Johnsen <johphi@gmail.com>2016-03-29 21:39:26 +0200
commit652782d1374600ebb0447e2323094ad2c8616823 (patch)
tree74a6aac4eab6fd26cff5d73425d80a105b533631
parentd38503ab01c607ca55b4816e2c249411a3f10269 (diff)
downloadnode-new-652782d1374600ebb0447e2323094ad2c8616823.tar.gz
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>
-rw-r--r--test/fixtures/baz.js1
-rw-r--r--test/parallel/test-repl-require.js4
2 files changed, 3 insertions, 2 deletions
diff --git a/test/fixtures/baz.js b/test/fixtures/baz.js
new file mode 100644
index 0000000000..3187340bcb
--- /dev/null
+++ b/test/fixtures/baz.js
@@ -0,0 +1 @@
+module.exports = 'perhaps I work';
diff --git a/test/parallel/test-repl-require.js b/test/parallel/test-repl-require.js
index c964951c2c..2638b9643c 100644
--- a/test/parallel/test-repl-require.js
+++ b/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');
});