Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test: use async/await in test-debugger-profile
PR-URL: #44684
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
surbhirjain authored and danielleadams committed Oct 5, 2022
1 parent 4db72a6 commit 0b2e8b1
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/sequential/test-debugger-profile.js
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);
}

}

0 comments on commit 0b2e8b1

Please sign in to comment.