Skip to content

Commit

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

}

0 comments on commit 29dbc08

Please sign in to comment.