/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.1.0
test/sequential/test-debug-prompt.js
18 строк
445 B
Rich Trott
test: fix flaky test-debug-prompt
16 июл 2018, 08:50
16 июл 2018, 08:50
df97126
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); common.skipIfInspectorDisabled(); const spawn = require('child_process').spawn; const proc = spawn(process.execPath, ['inspect', 'foo']); proc.stdout.setEncoding('utf8'); let needToSendExit = true; let output = ''; proc.stdout.on('data', (data) => { output += data; if (output.includes('debug> ') && needToSendExit) { proc.stdin.write('.exit\n'); needToSendExit = false; } });