Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbfec29

Browse filesBrowse files
thefourtheyeMylesBorins
authored andcommitted
test: fix and improve debug-break-on-uncaught
This test runs based on a expectation that the stderr will get the string 'Debugger listening on port'. But the actual message printed to stderr has changed to 'Debugger listening on host:port'. So the the actuals tests did not even start and eventually timeout. Apart from that, changed `var`s to `let`s or `const`s. Refs: #10361 PR-URL: #10370 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com
1 parent 80f4a37 commit dbfec29
Copy full SHA for dbfec29

File tree

Expand file treeCollapse file tree

1 file changed

+12
-13
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-13
lines changed
Open diff view settings
Collapse file

‎test/debugger/test-debug-break-on-uncaught.js‎

Copy file name to clipboardExpand all lines: test/debugger/test-debug-break-on-uncaught.js
+12-13Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const spawn = require('child_process').spawn;
55
const common = require('../common');
66
const debug = require('_debugger');
77

8-
var scenarios = [];
8+
const scenarios = [];
99

1010
addScenario('global.js', 2);
1111
addScenario('timeout.js', 2);
@@ -21,34 +21,33 @@ function addScenario(scriptName, throwsOnLine) {
2121
}
2222

2323
function run() {
24-
var next = scenarios.shift();
24+
const next = scenarios.shift();
2525
if (next) next();
2626
}
2727

2828
function runScenario(scriptName, throwsOnLine, next) {
29-
console.log('**[ %s ]**', scriptName);
30-
var asserted = false;
31-
var port = common.PORT;
29+
let asserted = false;
30+
const port = common.PORT;
3231

33-
var testScript = path.join(
32+
const testScript = path.join(
3433
common.fixturesDir,
3534
'uncaught-exceptions',
3635
scriptName
3736
);
3837

39-
var child = spawn(process.execPath, [ '--debug-brk=' + port, testScript ]);
38+
const child = spawn(process.execPath, [ '--debug-brk=' + port, testScript ]);
4039
child.on('close', function() {
4140
assert(asserted, 'debugger did not pause on exception');
4241
if (next) next();
4342
});
4443

45-
var exceptions = [];
44+
const exceptions = [];
4645

47-
var stderr = '';
46+
let stderr = '';
4847

4948
function stderrListener(data) {
5049
stderr += data;
51-
if (stderr.includes('Debugger listening on port')) {
50+
if (stderr.includes('Debugger listening on ')) {
5251
setTimeout(setupClient.bind(null, runTest), 200);
5352
child.stderr.removeListener('data', stderrListener);
5453
}
@@ -58,7 +57,7 @@ function runScenario(scriptName, throwsOnLine, next) {
5857
child.stderr.on('data', stderrListener);
5958

6059
function setupClient(callback) {
61-
var client = new debug.Client();
60+
const client = new debug.Client();
6261

6362
client.once('ready', callback.bind(null, client));
6463

@@ -83,14 +82,14 @@ function runScenario(scriptName, throwsOnLine, next) {
8382
enabled: true
8483
}
8584
},
86-
function(error, result) {
85+
function(error) {
8786
assert.ifError(error);
8887

8988
client.on('exception', function(event) {
9089
exceptions.push(event.body);
9190
});
9291

93-
client.reqContinue(function(error, result) {
92+
client.reqContinue(function(error) {
9493
assert.ifError(error);
9594
setTimeout(assertHasPaused.bind(null, client), 100);
9695
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.