--inspect can no longer be used as a flag through gulp (#42701)

* --inspect can no longer be used as a flag through gulp

* Add --break alias

* Update scripts/build/options.js
This commit is contained in:
Andrew Branch 2021-02-12 16:01:22 -08:00 коммит произвёл GitHub
Родитель e5294b4d3c
Коммит d3055f0f29
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 9 добавлений и 17 удалений

Просмотреть файл

@ -153,10 +153,10 @@ gulp runtests --tests=2dArrays
## Debugging the tests
You can debug with VS Code or Node instead with `gulp runtests --inspect`:
You can debug with VS Code or Node instead with `gulp runtests -i`:
```Shell
gulp runtests --tests=2dArrays --inspect
gulp runtests --tests=2dArrays -i
```
You can also use the [provided VS Code launch configuration](./.vscode/launch.template.json) to launch a debug session for an open test file. Rename the file 'launch.json', open the test file of interest, and launch the debugger from the debug panel (or press F5).

Просмотреть файл

@ -453,8 +453,7 @@ task("runtests").flags = {
"-t --tests=<regex>": "Pattern for tests to run.",
" --failed": "Runs tests listed in '.failed-tests'.",
"-r --reporter=<reporter>": "The mocha reporter to use.",
"-d --debug": "Runs tests in debug mode (NodeJS 6 and earlier)",
"-i --inspect": "Runs tests in inspector mode (NodeJS 8 and later)",
"-i --break": "Runs tests in inspector mode (NodeJS 8 and later)",
" --keepFailed": "Keep tests in .failed-tests even if they pass",
" --light": "Run tests in light mode (fewer verifications, but tests run faster)",
" --dirty": "Run tests without first cleaning test output directories",

Просмотреть файл

@ -4,12 +4,11 @@ const os = require("os");
/** @type {CommandLineOptions} */
module.exports = minimist(process.argv.slice(2), {
boolean: ["debug", "dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
string: ["browser", "tests", "inspect", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
alias: {
"b": "browser",
"d": ["debug", "debug-brk"],
"i": ["inspect", "inspect-brk"],
"i": ["inspect", "inspect-brk", "break", "debug", "debug-brk"],
"t": ["tests", "test"],
"ru": ["runners", "runner"],
"r": "reporter",
@ -47,7 +46,6 @@ if (module.exports.built) {
/**
* @typedef TypedOptions
* @property {boolean} debug
* @property {boolean} dirty
* @property {boolean} light
* @property {boolean} colors
@ -58,7 +56,7 @@ if (module.exports.built) {
* @property {boolean} fix
* @property {string} browser
* @property {string} tests
* @property {string} inspect
* @property {string | boolean} inspect
* @property {string} runners
* @property {string|number} workers
* @property {string} host

Просмотреть файл

@ -27,8 +27,7 @@ exports.localTest262Baseline = "internal/baselines/test262/local";
async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, cancelToken = CancellationToken.none) {
let testTimeout = cmdLineOptions.timeout;
let tests = cmdLineOptions.tests;
const debug = cmdLineOptions.debug;
const inspect = cmdLineOptions.inspect;
const inspect = cmdLineOptions.break || cmdLineOptions.inspect;
const runners = cmdLineOptions.runners;
const light = cmdLineOptions.light;
const stackTraceLimit = cmdLineOptions.stackTraceLimit;
@ -101,11 +100,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
args.push("--no-colors");
}
if (inspect !== undefined) {
args.unshift(inspect == "" ? "--inspect-brk" : "--inspect-brk="+inspect);
args.push("-t", "0");
}
else if (debug) {
args.unshift("--debug-brk");
args.unshift((inspect == "" || inspect === true) ? "--inspect-brk" : "--inspect-brk="+inspect);
args.push("-t", "0");
}
else {