Skip to content

Commit aef35b5

Browse files
committed
fixup! test,debugger: migrate node-inspect tests to core
1 parent 3e4142f commit aef35b5

File tree

4 files changed

+90
-72
lines changed

4 files changed

+90
-72
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
common.skipIfInspectorDisabled();
5+
6+
const fixtures = require('../common/fixtures');
7+
const startCLI = require('../common/inspector-cli');
8+
9+
const assert = require('assert');
10+
11+
// Custom port.
12+
{
13+
const script = fixtures.path('inspector-cli', 'three-lines.js');
14+
15+
const cli = startCLI([`--port=${common.PORT}`, script]);
16+
17+
cli.waitForInitialBreak()
18+
.then(() => cli.waitForPrompt())
19+
.then(() => {
20+
assert.match(cli.output, /debug>/, 'prints a prompt');
21+
assert.match(
22+
cli.output,
23+
new RegExp(`< Debugger listening on [^\n]*${common.PORT}`),
24+
'forwards child output');
25+
})
26+
.then(() => cli.quit())
27+
.then((code) => {
28+
assert.strictEqual(code, 0);
29+
});
30+
}

test/inspector-cli/test-inspector-cli-launch-ports.js

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
common.skipIfInspectorDisabled();
5+
6+
const fixtures = require('../common/fixtures');
7+
const startCLI = require('../common/inspector-cli');
8+
9+
const assert = require('assert');
10+
11+
// Random port with --inspect-port=0.
12+
{
13+
const script = fixtures.path('inspector-cli', 'three-lines.js');
14+
15+
const cli = startCLI(['--inspect-port=0', script]);
16+
17+
cli.waitForInitialBreak()
18+
.then(() => cli.waitForPrompt())
19+
.then(() => {
20+
assert.match(cli.output, /debug>/, 'prints a prompt');
21+
assert.match(
22+
cli.output,
23+
/< Debugger listening on /,
24+
'forwards child output');
25+
})
26+
.then(() => cli.quit())
27+
.then((code) => {
28+
assert.strictEqual(code, 0);
29+
});
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
common.skipIfInspectorDisabled();
5+
6+
const fixtures = require('../common/fixtures');
7+
const startCLI = require('../common/inspector-cli');
8+
9+
const assert = require('assert');
10+
11+
// Random port.
12+
{
13+
const script = fixtures.path('inspector-cli', 'three-lines.js');
14+
15+
const cli = startCLI(['--port=0', script]);
16+
17+
cli.waitForInitialBreak()
18+
.then(() => cli.waitForPrompt())
19+
.then(() => {
20+
assert.match(cli.output, /debug>/, 'prints a prompt');
21+
assert.match(
22+
cli.output,
23+
/< Debugger listening on /,
24+
'forwards child output');
25+
})
26+
.then(() => cli.quit())
27+
.then((code) => {
28+
assert.strictEqual(code, 0);
29+
});
30+
}

0 commit comments

Comments
 (0)