Skip to content

Commit 06ba00e

Browse files
committed
test: move debugger test case to parallel
Move test case that does not require a predetermined port to parallel.
1 parent a8a8638 commit 06ba00e

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
constcommon=require('../common');
3+
4+
common.skipIfInspectorDisabled();
5+
6+
constfixtures=require('../common/fixtures');
7+
conststartCLI=require('../common/debugger');
8+
9+
constassert=require('assert');
10+
const{ createServer }=require('net');
11+
12+
// Launch w/ unavailable port.
13+
(async()=>{
14+
constblocker=createServer((socket)=>socket.end());
15+
constport=awaitnewPromise((resolve,reject)=>{
16+
blocker.on('error',reject);
17+
blocker.listen(0,'127.0.0.1',()=>resolve(blocker.address().port));
18+
});
19+
20+
try{
21+
constscript=fixtures.path('debugger','three-lines.js');
22+
constcli=startCLI([`--port=${port}`,script]);
23+
constcode=awaitcli.quit();
24+
25+
assert.doesNotMatch(
26+
cli.output,
27+
/reportthisbug/,
28+
'Omits message about reporting this as a bug');
29+
assert.ok(
30+
cli.output.includes(`waiting for 127.0.0.1:${port} to be free`),
31+
'Tells the user that the port wasn\'t available');
32+
assert.strictEqual(code,1);
33+
}finally{
34+
blocker.close();
35+
}
36+
})().then(common.mustCall());

‎test/sequential/test-debugger-invalid-args.js‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ const common = require('../common');
33

44
common.skipIfInspectorDisabled();
55

6-
constfixtures=require('../common/fixtures');
76
conststartCLI=require('../common/debugger');
87

98
constassert=require('assert');
10-
const{ createServer }=require('net');
119

1210
// Launch CLI w/o args.
1311
{
@@ -31,29 +29,3 @@ const{createServer } = require('net');
3129
assert.strictEqual(code,1);
3230
});
3331
}
34-
35-
// Launch w/ unavailable port.
36-
(async()=>{
37-
constblocker=createServer((socket)=>socket.end());
38-
constport=awaitnewPromise((resolve,reject)=>{
39-
blocker.on('error',reject);
40-
blocker.listen(0,'127.0.0.1',()=>resolve(blocker.address().port));
41-
});
42-
43-
try{
44-
constscript=fixtures.path('debugger','three-lines.js');
45-
constcli=startCLI([`--port=${port}`,script]);
46-
constcode=awaitcli.quit();
47-
48-
assert.doesNotMatch(
49-
cli.output,
50-
/reportthisbug/,
51-
'Omits message about reporting this as a bug');
52-
assert.ok(
53-
cli.output.includes(`waiting for 127.0.0.1:${port} to be free`),
54-
'Tells the user that the port wasn\'t available');
55-
assert.strictEqual(code,1);
56-
}finally{
57-
blocker.close();
58-
}
59-
})().then(common.mustCall());

0 commit comments

Comments
(0)