-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
553c94c
commit d160567
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const ArrayStream = require('../common/arraystream'); | ||
const assert = require('assert'); | ||
const repl = require('repl'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const inputStream = new ArrayStream(); | ||
const outputStream = new ArrayStream(); | ||
repl.start({ | ||
input: inputStream, | ||
output: outputStream, | ||
useGlobal: false, | ||
terminal: true, | ||
useColors: true | ||
}); | ||
|
||
let output = ''; | ||
outputStream.write = (chunk) => output += chunk; | ||
|
||
// Input without '\n' triggering actual run. | ||
const input = 'while (true) {}'; | ||
inputStream.emit('data', input); | ||
// No preview available when timed out. | ||
assert.strictEqual(output, input); |