Skip to content

Commit dda556d

Browse 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

2 files changed

Lines changed: 49 additions & 48 deletions

File tree

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

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines 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+
importstartCLIfrom'../common/debugger.js';
6+
7+
importassertfrom'assert';
8+
9+
constscript=path('debugger','break.js');
10+
constcli=startCLI([script]);
11+
12+
functiononFatal(error){
13+
cli.quit();
14+
throwerror;
15+
}
16+
17+
// Stepping through breakpoints.
18+
try{
19+
awaitcli.waitForInitialBreak();
20+
awaitcli.waitForPrompt();
21+
awaitcli.command('watch("x")');
22+
awaitcli.command('watch("\\"Hello\\"")');
23+
awaitcli.command('watch("42")');
24+
awaitcli.command('watch("NaN")');
25+
awaitcli.command('watch("true")');
26+
awaitcli.command('watch("[1, 2]")');
27+
awaitcli.command('watch("process.env")');
28+
awaitcli.command('watchers');
29+
30+
assert.match(cli.output,/xisnotdefined/);
31+
32+
awaitcli.command('unwatch("42")');
33+
awaitcli.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+
awaitcli.quit();
47+
}catch(error){
48+
onFatal(error);
49+
}

0 commit comments

Comments
 (0)