Skip to content
Permalink
Browse files
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 0b2e8b1681d70e7359af851bc34d30c39f289e5c
Showing 1 changed file with 14 additions and 11 deletions.
@@ -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.