Skip to content

Commit

Permalink
--inspect can no longer be used as a flag through gulp (#42701)
Browse files Browse the repository at this point in the history
* --inspect can no longer be used as a flag through gulp

* Add --break alias

* Update scripts/build/options.js
  • Loading branch information
andrewbranch authored Feb 13, 2021
1 parent e5294b4 commit d3055f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 1 addition & 2 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 4 additions & 6 deletions scripts/build/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -47,7 +46,6 @@ if (module.exports.built) {

/**
* @typedef TypedOptions
* @property {boolean} debug
* @property {boolean} dirty
* @property {boolean} light
* @property {boolean} colors
Expand All @@ -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
Expand Down
9 changes: 2 additions & 7 deletions scripts/build/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d3055f0

Please sign in to comment.