/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v22.23.2
test/sequential/test-debugger-pid.js
35 строк
860 B
Dario Piotrowicz
test: update `startCLI` to set `--port=0` by default
04 авг 2025, 14:35
Не верифицирован
04 авг 2025, 14:35
a23562f
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); common.skipIfInspectorDisabled(); const fixtures = require('../common/fixtures'); const startCLI = require('../common/debugger'); const assert = require('assert'); const { spawn } = require('child_process'); const script = fixtures.path('debugger', 'alive.js'); const runTest = async () => { const target = spawn(process.execPath, [script]); const cli = startCLI(['-p', `${target.pid}`], [], {}, { randomPort: false }); try { await cli.waitForPrompt(); await cli.command('sb("alive.js", 3)'); await cli.waitFor(/break/); await cli.waitForPrompt(); assert.match( cli.output, /> 3 {3}\+\+x;/, 'marks the 3rd line'); } catch (error) { assert.ifError(error); } finally { await cli.quit(); target.kill(); } }; runTest().then(common.mustCall());