GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: migrated from Promise chains to Async/Await · nodejs/node@143c428

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/sequential
    • test-debugger-restart-message.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/sequential/test-debugger-restart-message.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-restart-message.js
+11-13Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ const startCLI = require('../common/debugger');
1616
const script = fixtures.path('debugger', 'three-lines.js');
1717
const cli = startCLI([script]);
1818

19-
function onFatal(error) {
20-
cli.quit();
21-
throw error;
22-
}
23-
2419
const listeningRegExp = /Debugger listening on/g;
2520

26-
cli.waitForInitialBreak()
27-
.then(() => cli.waitForPrompt())
28-
.then(() => {
21+
async function onWaitForInitialBreak() {
22+
try {
23+
await cli.waitForInitialBreak();
24+
await cli.waitForPrompt();
2925
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
30-
})
31-
.then(async () => {
26+
3227
for (let i = 0; i < RESTARTS; i++) {
3328
await cli.stepCommand('restart');
3429
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
3530
}
36-
})
37-
.then(() => cli.quit())
38-
.then(null, onFatal);
31+
} finally {
32+
await cli.quit();
33+
}
34+
}
35+
36+
onWaitForInitialBreak();
3937
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.