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'); });