Squashed from: - deps: Add node-inspect 1.10.1 This adds a reimplementation of the old CLI debugger (`node debug`) against the new debugger protocol (`node --inspect`). This is necessary because the old protocol won't be supported in future versions of V8. - deps: Update node-inspect to 1.10.2 Starting with 1.10.2 the test suite should pass consistently on windows. - deps: Update to node-inspect 1.10.4 PR-URL: https://github.com/nodejs/node/pull/10187 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
'use strict';
|
|
const { test } = require('tap');
|
|
|
|
const startCLI = require('./start-cli');
|
|
|
|
test('stepping through breakpoints', (t) => {
|
|
const cli = startCLI(['examples/break.js']);
|
|
|
|
function onFatal(error) {
|
|
cli.quit();
|
|
throw error;
|
|
}
|
|
|
|
return cli.waitFor(/break/)
|
|
.then(() => cli.waitForPrompt())
|
|
.then(() => cli.command('watch("x")'))
|
|
.then(() => cli.command('watch("\\"Hello\\"")'))
|
|
.then(() => cli.command('watch("42")'))
|
|
.then(() => cli.command('watch("NaN")'))
|
|
.then(() => cli.command('watch("true")'))
|
|
.then(() => cli.command('watch("[1, 2]")'))
|
|
.then(() => cli.command('watch("process.env")'))
|
|
.then(() => cli.command('watchers'))
|
|
.then(() => {
|
|
t.match(cli.output, 'x is not defined');
|
|
})
|
|
.then(() => cli.command('unwatch("42")'))
|
|
.then(() => cli.stepCommand('n'))
|
|
.then(() => {
|
|
t.match(cli.output, '0: x = 10');
|
|
t.match(cli.output, '1: "Hello" = \'Hello\'');
|
|
t.match(cli.output, '2: NaN = NaN');
|
|
t.match(cli.output, '3: true = true');
|
|
t.match(cli.output, '4: [1, 2] = [ 1, 2 ]');
|
|
t.match(
|
|
cli.output,
|
|
/5: process\.env =\n\s+\{[\s\S]+,\n\s+\.\.\. \}/,
|
|
'shows "..." for process.env');
|
|
})
|
|
.then(() => cli.quit())
|
|
.then(null, onFatal);
|
|
});
|