/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v24.15.0
test/sequential/test-debugger-invalid-args.js
27 строк
757 B
Dario Piotrowicz
test: update `startCLI` to set `--port=0` by default
21 июл 2025, 11:59
Не верифицирован
21 июл 2025, 11:59
82d4175
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); common.skipIfInspectorDisabled(); const startCLI = require('../common/debugger'); const assert = require('assert'); // Launch CLI w/o args. (async () => { const cli = startCLI([], [], {}, { randomPort: false }); const code = await cli.quit(); assert.strictEqual(code, 9); assert.match(cli.output, /^Usage:/, 'Prints usage info'); })().then(common.mustCall()); // Launch w/ invalid host:port. (async () => { const cli = startCLI([`localhost:${common.PORT}`], [], {}, { randomPort: false }); const code = await cli.quit(); assert.match( cli.output, /failed to connect/, 'Tells the user that the connection failed'); assert.strictEqual(code, 1); })().then(common.mustCall());