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 1172498

Browse filesBrowse files
ml7181RafaelGSS
authored andcommitted
test: update test-debugger-low-level to use await/async
PR-URL: #44688 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 29e3e2c commit 1172498
Copy full SHA for 1172498

File tree

Expand file treeCollapse file tree

1 file changed

+11
-15
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-15
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-debugger-low-level.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-low-level.js
+11-15Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,24 @@ const assert = require('assert');
1212
const cli = startCLI([fixtures.path('debugger/three-lines.js')]);
1313
const scriptPattern = /^\* (\d+): \S+debugger(?:\/|\\)three-lines\.js/m;
1414

15-
function onFatal(error) {
16-
cli.quit();
17-
throw error;
18-
}
19-
20-
return cli.waitForInitialBreak()
21-
.then(() => cli.waitForPrompt())
22-
.then(() => cli.command('scripts'))
23-
.then(() => {
15+
async function testDebuggerLowLevel() {
16+
try {
17+
await cli.waitForInitialBreak();
18+
await cli.waitForPrompt();
19+
await cli.command('scripts');
2420
const [, scriptId] = cli.output.match(scriptPattern);
25-
return cli.command(
21+
await cli.command(
2622
`Debugger.getScriptSource({ scriptId: '${scriptId}' })`
2723
);
28-
})
29-
.then(() => {
3024
assert.match(
3125
cli.output,
3226
/scriptSource:[ \n]*'(?:\(function \(|let x = 1)/);
3327
assert.match(
3428
cli.output,
3529
/let x = 1;/);
36-
})
37-
.then(() => cli.quit())
38-
.then(null, onFatal);
30+
} finally {
31+
await cli.quit();
32+
}
33+
}
34+
testDebuggerLowLevel();
3935
}

0 commit comments

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