mirror of
https://github.com/nodejs/node.git
synced 2025-05-19 09:44:08 +00:00

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>
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
'use strict';
|
|
const Path = require('path');
|
|
|
|
const { test } = require('tap');
|
|
|
|
const startCLI = require('./start-cli');
|
|
|
|
test('list scripts', (t) => {
|
|
const script = Path.join('examples', 'empty.js');
|
|
const cli = startCLI([script]);
|
|
|
|
function onFatal(error) {
|
|
cli.quit();
|
|
throw error;
|
|
}
|
|
|
|
return cli.waitFor(/break/)
|
|
.then(() => cli.waitForPrompt())
|
|
.then(() => cli.command('scripts'))
|
|
.then(() => {
|
|
t.match(
|
|
cli.output,
|
|
/^\* \d+: examples(?:\/|\\)empty\.js/,
|
|
'lists the user script');
|
|
t.notMatch(
|
|
cli.output,
|
|
/\d+: module\.js <native>/,
|
|
'omits node-internal scripts');
|
|
})
|
|
.then(() => cli.command('scripts(true)'))
|
|
.then(() => {
|
|
t.match(
|
|
cli.output,
|
|
/\* \d+: examples(?:\/|\\)empty\.js/,
|
|
'lists the user script');
|
|
t.match(
|
|
cli.output,
|
|
/\d+: module\.js <native>/,
|
|
'includes node-internal scripts');
|
|
})
|
|
.then(() => cli.quit())
|
|
.then(null, onFatal);
|
|
});
|