2024-10-21 13:52:36 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
|
const assert = require('assert');
|
2025-07-20 15:58:10 +01:00
|
|
|
const { startNewREPLServer } = require('../common/repl');
|
2024-10-21 13:52:36 +01:00
|
|
|
|
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
|
|
2025-07-20 15:58:10 +01:00
|
|
|
const { output, input } = startNewREPLServer();
|
2024-10-21 13:52:36 +01:00
|
|
|
|
2025-07-20 15:58:10 +01:00
|
|
|
output.accumulator = '';
|
2024-10-21 13:52:36 +01:00
|
|
|
|
|
|
|
|
// Input without '\n' triggering actual run.
|
2025-07-20 15:58:10 +01:00
|
|
|
const inputStr = 'while (true) {}';
|
|
|
|
|
input.emit('data', inputStr);
|
2024-10-21 13:52:36 +01:00
|
|
|
// No preview available when timed out.
|
2025-07-20 15:58:10 +01:00
|
|
|
assert.strictEqual(output.accumulator, inputStr);
|