mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
590cf569fe
PR-URL: https://github.com/nodejs/node/pull/45179 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
36 lines
829 B
JavaScript
36 lines
829 B
JavaScript
'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}`]);
|
|
|
|
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());
|