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 dda556d

Browse filesBrowse files
Pooja444RafaelGSS
authored andcommitted
test: change promise to async/await in debugger-watcher
PR-URL: #44687 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent ce71929 commit dda556d
Copy full SHA for dda556d

File tree

Expand file treeCollapse file tree

2 files changed

+49
-48
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+49
-48
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-debugger-watchers.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-watchers.js
-48Lines changed: 0 additions & 48 deletions
This file was deleted.
Collapse file
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { skipIfInspectorDisabled } from '../common/index.mjs';
2+
skipIfInspectorDisabled();
3+
4+
import { path } from '../common/fixtures.mjs';
5+
import startCLI from '../common/debugger.js';
6+
7+
import assert from 'assert';
8+
9+
const script = path('debugger', 'break.js');
10+
const cli = startCLI([script]);
11+
12+
function onFatal(error) {
13+
cli.quit();
14+
throw error;
15+
}
16+
17+
// Stepping through breakpoints.
18+
try {
19+
await cli.waitForInitialBreak();
20+
await cli.waitForPrompt();
21+
await cli.command('watch("x")');
22+
await cli.command('watch("\\"Hello\\"")');
23+
await cli.command('watch("42")');
24+
await cli.command('watch("NaN")');
25+
await cli.command('watch("true")');
26+
await cli.command('watch("[1, 2]")');
27+
await cli.command('watch("process.env")');
28+
await cli.command('watchers');
29+
30+
assert.match(cli.output, /x is not defined/);
31+
32+
await cli.command('unwatch("42")');
33+
await cli.stepCommand('n');
34+
35+
assert.match(cli.output, /0: x = 10/);
36+
assert.match(cli.output, /1: "Hello" = 'Hello'/);
37+
assert.match(cli.output, /2: NaN = NaN/);
38+
assert.match(cli.output, /3: true = true/);
39+
assert.match(cli.output, /4: \[1, 2\] = \[ 1, 2 \]/);
40+
assert.match(
41+
cli.output,
42+
/5: process\.env =\n\s+\{[\s\S]+,\n\s+\.\.\. \}/,
43+
'shows "..." for process.env'
44+
);
45+
46+
await cli.quit();
47+
} catch (error) {
48+
onFatal(error);
49+
}

0 commit comments

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