-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! test,debugger: migrate node-inspect tests to core
- Loading branch information
Showing
4 changed files
with
90 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const fixtures = require('../common/fixtures'); | ||
const startCLI = require('../common/inspector-cli'); | ||
|
||
const assert = require('assert'); | ||
|
||
// Custom port. | ||
{ | ||
const script = fixtures.path('inspector-cli', 'three-lines.js'); | ||
|
||
const cli = startCLI([`--port=${common.PORT}`, script]); | ||
|
||
cli.waitForInitialBreak() | ||
.then(() => cli.waitForPrompt()) | ||
.then(() => { | ||
assert.match(cli.output, /debug>/, 'prints a prompt'); | ||
assert.match( | ||
cli.output, | ||
new RegExp(`< Debugger listening on [^\n]*${common.PORT}`), | ||
'forwards child output'); | ||
}) | ||
.then(() => cli.quit()) | ||
.then((code) => { | ||
assert.strictEqual(code, 0); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
test/inspector-cli/test-inspector-cli-random-port-with-inspect-port.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const fixtures = require('../common/fixtures'); | ||
const startCLI = require('../common/inspector-cli'); | ||
|
||
const assert = require('assert'); | ||
|
||
// Random port with --inspect-port=0. | ||
{ | ||
const script = fixtures.path('inspector-cli', 'three-lines.js'); | ||
|
||
const cli = startCLI(['--inspect-port=0', script]); | ||
|
||
cli.waitForInitialBreak() | ||
.then(() => cli.waitForPrompt()) | ||
.then(() => { | ||
assert.match(cli.output, /debug>/, 'prints a prompt'); | ||
assert.match( | ||
cli.output, | ||
/< Debugger listening on /, | ||
'forwards child output'); | ||
}) | ||
.then(() => cli.quit()) | ||
.then((code) => { | ||
assert.strictEqual(code, 0); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const fixtures = require('../common/fixtures'); | ||
const startCLI = require('../common/inspector-cli'); | ||
|
||
const assert = require('assert'); | ||
|
||
// Random port. | ||
{ | ||
const script = fixtures.path('inspector-cli', 'three-lines.js'); | ||
|
||
const cli = startCLI(['--port=0', script]); | ||
|
||
cli.waitForInitialBreak() | ||
.then(() => cli.waitForPrompt()) | ||
.then(() => { | ||
assert.match(cli.output, /debug>/, 'prints a prompt'); | ||
assert.match( | ||
cli.output, | ||
/< Debugger listening on /, | ||
'forwards child output'); | ||
}) | ||
.then(() => cli.quit()) | ||
.then((code) => { | ||
assert.strictEqual(code, 0); | ||
}); | ||
} |