Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions test/parallel/test-force-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

// spawn a node child process in "interactive" mode (force the repl)
// Spawn a node child process in interactive mode (enabling the REPL) and
// confirm the '> ' prompt is included in the output.
const cp = spawn(process.execPath, ['-i']);
// give node + the repl 5 seconds to start
const timeoutId = setTimeout(common.mustNotCall(),
common.platformTimeout(5000));

cp.stdout.setEncoding('utf8');

cp.stdout.once('data', common.mustCall(function(b) {
clearTimeout(timeoutId);
assert.strictEqual(b, '> ');
cp.kill();
}));