Skip to content

Commit 2baa3c3

Browse files
surbhirjainjuanarbol
authored andcommitted
test: use async/await in test-debugger-profile
PR-URL: #44684 Reviewed-By: Rich Trott <[email protected]>
1 parent ffc4fad commit 2baa3c3

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

test/sequential/test-debugger-profile.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ function delay(ms) {
2121
throw error;
2222
}
2323

24-
return cli.waitForInitialBreak()
25-
.then(() => cli.waitForPrompt())
26-
.then(() => cli.command('exec console.profile()'))
27-
.then(() => {
24+
try {
25+
(async () => {
26+
await cli.waitForInitialBreak();
27+
await cli.waitForPrompt();
28+
await cli.command('exec console.profile()');
2829
assert.match(cli.output, /undefined/);
29-
})
30-
.then(() => cli.command('exec console.profileEnd()'))
31-
.then(() => delay(250))
32-
.then(() => {
30+
await cli.command('exec console.profileEnd()');
31+
await delay(250);
3332
assert.match(cli.output, /undefined/);
3433
assert.match(cli.output, /Captured new CPU profile\./);
35-
})
36-
.then(() => cli.quit())
37-
.then(null, onFatal);
34+
await cli.quit();
35+
})()
36+
.then(common.mustCall());
37+
} catch (error) {
38+
return onFatal(error);
39+
}
40+
3841
}

0 commit comments

Comments
 (0)