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: use async/await in test-debugger-sb-before-load · nodejs/node@eeabd23

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/sequential
    • test-debugger-sb-before-load.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/sequential/test-debugger-sb-before-load.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-sb-before-load.js
+21-32Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,24 @@ const assert = require('assert');
1010
const path = require('path');
1111

1212
// Using sb before loading file.
13-
{
14-
const scriptFullPath = fixtures.path('debugger', 'cjs', 'index.js');
15-
const script = path.relative(process.cwd(), scriptFullPath);
16-
17-
const otherScriptFullPath = fixtures.path('debugger', 'cjs', 'other.js');
18-
const otherScript = path.relative(process.cwd(), otherScriptFullPath);
19-
20-
const cli = startCLI([script]);
21-
22-
function onFatal(error) {
23-
cli.quit();
24-
throw error;
25-
}
26-
27-
cli.waitForInitialBreak()
28-
.then(() => cli.waitForPrompt())
29-
.then(() => cli.command('sb("other.js", 2)'))
30-
.then(() => {
31-
assert.match(
32-
cli.output,
33-
/not loaded yet/,
34-
'warns that the script was not loaded yet');
35-
})
36-
.then(() => cli.stepCommand('cont'))
37-
.then(() => {
38-
assert.ok(
39-
cli.output.includes(`break in ${otherScript}:2`),
40-
'found breakpoint in file that was not loaded yet');
41-
})
42-
.then(() => cli.quit())
43-
.then(null, onFatal);
44-
}
13+
14+
const scriptFullPath = fixtures.path('debugger', 'cjs', 'index.js');
15+
const script = path.relative(process.cwd(), scriptFullPath);
16+
17+
const otherScriptFullPath = fixtures.path('debugger', 'cjs', 'other.js');
18+
const otherScript = path.relative(process.cwd(), otherScriptFullPath);
19+
20+
const cli = startCLI([script]);
21+
22+
(async () => {
23+
await cli.waitForInitialBreak();
24+
await cli.waitForPrompt();
25+
await cli.command('sb("other.js", 2)');
26+
assert.match(cli.output, /not loaded yet/,
27+
'warns that the script was not loaded yet');
28+
await cli.stepCommand('cont');
29+
assert.ok(cli.output.includes(`break in ${otherScript}:2`),
30+
'found breakpoint in file that was not loaded yet');
31+
})()
32+
.then(common.mustCall())
33+
.finally(() => cli.quit());

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.