Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want -i to be the shorthand for `--break?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 it's backward compatible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd sorta doubt anyone is taking a hard automated dependency on it, so I wouldn't worry about that too much. 😄

Either way I'll leave it up to you

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-b is already taken by --browser despite not being documented in the Gulpfile, so I’m not sure what else to call it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well...who even runs that one? Anyway, it's not a big deal.

" --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