Skip to content

Commit d3055f0

Browse files
authored
--inspect can no longer be used as a flag through gulp (microsoft#42701)
* --inspect can no longer be used as a flag through gulp * Add --break alias * Update scripts/build/options.js
1 parent e5294b4 commit d3055f0

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ gulp runtests --tests=2dArrays
153153

154154
## Debugging the tests
155155

156-
You can debug with VS Code or Node instead with `gulp runtests --inspect`:
156+
You can debug with VS Code or Node instead with `gulp runtests -i`:
157157

158158
```Shell
159-
gulp runtests --tests=2dArrays --inspect
159+
gulp runtests --tests=2dArrays -i
160160
```
161161

162162
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).

Gulpfile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ task("runtests").flags = {
453453
"-t --tests=<regex>": "Pattern for tests to run.",
454454
" --failed": "Runs tests listed in '.failed-tests'.",
455455
"-r --reporter=<reporter>": "The mocha reporter to use.",
456-
"-d --debug": "Runs tests in debug mode (NodeJS 6 and earlier)",
457-
"-i --inspect": "Runs tests in inspector mode (NodeJS 8 and later)",
456+
"-i --break": "Runs tests in inspector mode (NodeJS 8 and later)",
458457
" --keepFailed": "Keep tests in .failed-tests even if they pass",
459458
" --light": "Run tests in light mode (fewer verifications, but tests run faster)",
460459
" --dirty": "Run tests without first cleaning test output directories",

scripts/build/options.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ const os = require("os");
44

55
/** @type {CommandLineOptions} */
66
module.exports = minimist(process.argv.slice(2), {
7-
boolean: ["debug", "dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
8-
string: ["browser", "tests", "inspect", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
7+
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
8+
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
1010
"b": "browser",
11-
"d": ["debug", "debug-brk"],
12-
"i": ["inspect", "inspect-brk"],
11+
"i": ["inspect", "inspect-brk", "break", "debug", "debug-brk"],
1312
"t": ["tests", "test"],
1413
"ru": ["runners", "runner"],
1514
"r": "reporter",
@@ -47,7 +46,6 @@ if (module.exports.built) {
4746

4847
/**
4948
* @typedef TypedOptions
50-
* @property {boolean} debug
5149
* @property {boolean} dirty
5250
* @property {boolean} light
5351
* @property {boolean} colors
@@ -58,7 +56,7 @@ if (module.exports.built) {
5856
* @property {boolean} fix
5957
* @property {string} browser
6058
* @property {string} tests
61-
* @property {string} inspect
59+
* @property {string | boolean} inspect
6260
* @property {string} runners
6361
* @property {string|number} workers
6462
* @property {string} host

scripts/build/tests.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ exports.localTest262Baseline = "internal/baselines/test262/local";
2727
async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, cancelToken = CancellationToken.none) {
2828
let testTimeout = cmdLineOptions.timeout;
2929
let tests = cmdLineOptions.tests;
30-
const debug = cmdLineOptions.debug;
31-
const inspect = cmdLineOptions.inspect;
30+
const inspect = cmdLineOptions.break || cmdLineOptions.inspect;
3231
const runners = cmdLineOptions.runners;
3332
const light = cmdLineOptions.light;
3433
const stackTraceLimit = cmdLineOptions.stackTraceLimit;
@@ -101,11 +100,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
101100
args.push("--no-colors");
102101
}
103102
if (inspect !== undefined) {
104-
args.unshift(inspect == "" ? "--inspect-brk" : "--inspect-brk="+inspect);
105-
args.push("-t", "0");
106-
}
107-
else if (debug) {
108-
args.unshift("--debug-brk");
103+
args.unshift((inspect == "" || inspect === true) ? "--inspect-brk" : "--inspect-brk="+inspect);
109104
args.push("-t", "0");
110105
}
111106
else {

0 commit comments

Comments
 (0)