Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the promises to async/await in test/sequential/test-debugger-p… #44684

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions test/sequential/test-debugger-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ function delay(ms) {
throw error;
}

return cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.command('exec console.profile()'))
.then(() => {
try {
(async () => {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec console.profile()');
assert.match(cli.output, /undefined/);
})
.then(() => cli.command('exec console.profileEnd()'))
.then(() => delay(250))
.then(() => {
await cli.command('exec console.profileEnd()');
await delay(250);
assert.match(cli.output, /undefined/);
assert.match(cli.output, /Captured new CPU profile\./);
})
.then(() => cli.quit())
.then(null, onFatal);
await cli.quit();
})()
.then(common.mustCall());
} catch (error) {
return onFatal(error);
}

}