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

test: change promises to async/await in test-debugger-backtrace.js #44677

Merged
merged 11 commits into from
Sep 29, 2022
25 changes: 14 additions & 11 deletions test/sequential/test-debugger-backtrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ const path = require('path');
throw error;
}
Trott marked this conversation as resolved.
Show resolved Hide resolved

return cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.stepCommand('c'))
.then(() => cli.command('bt'))
.then(() => {
async function onWaitForInitialBreak() {
Trott marked this conversation as resolved.
Show resolved Hide resolved
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.stepCommand('c');
await cli.command('bt');
assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`));
})
.then(() => cli.command('backtrace'))
.then(() => {
await cli.command('backtrace');
assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`));
})
.then(() => cli.quit())
.then(null, onFatal);
await cli.quit();
Trott marked this conversation as resolved.
Show resolved Hide resolved
} catch (error) {
return onFatal(error);
Trott marked this conversation as resolved.
Show resolved Hide resolved
Trott marked this conversation as resolved.
Show resolved Hide resolved
}
}

onWaitForInitialBreak();
Trott marked this conversation as resolved.
Show resolved Hide resolved
}