From d3055f0f2942524e79495cd10705df57b7d4ab3c Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 12 Feb 2021 16:01:22 -0800 Subject: [PATCH] --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 --- CONTRIBUTING.md | 4 ++-- Gulpfile.js | 3 +-- scripts/build/options.js | 10 ++++------ scripts/build/tests.js | 9 ++------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95437f807ce..8044198b1a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). diff --git a/Gulpfile.js b/Gulpfile.js index afd4b24e8f3..8e48e613aa0 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -453,8 +453,7 @@ task("runtests").flags = { "-t --tests=": "Pattern for tests to run.", " --failed": "Runs tests listed in '.failed-tests'.", "-r --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", diff --git a/scripts/build/options.js b/scripts/build/options.js index a5c1413e7d1..5d4aad6f5fc 100644 --- a/scripts/build/options.js +++ b/scripts/build/options.js @@ -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 diff --git a/scripts/build/tests.js b/scripts/build/tests.js index 5a6297768ee..7fee32566dd 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -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 {