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

chore(cli): Migrate some unit tests to "Promise.withResolvers()" #21128

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

tmdh
Copy link
Contributor

@tmdh tmdh commented Nov 9, 2023

Migrate to use Promise.withResolvers() instead of deferred in some of the tests in cli/tests/unit/.
Issue: #21041

@CLAassistant
Copy link

CLAassistant commented Nov 9, 2023

CLA assistant check
All committers have signed the CLA.

@@ -172,19 +172,23 @@ Deno.test(async function multipleCrons() {

let count0 = 0;
let count1 = 0;
const promise0 = deferred();
const promise1 = deferred();
const { promise: promise0, resolve: resolve0 } = Promise.withResolvers<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit/bikeshed: stylistically it might be better to do const promise0 = Promise.withResolvers(...) and then promise0.resolve and await promise0.promise.

Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmastrac mmastrac merged commit eff3e43 into denoland:main Nov 10, 2023
13 checks passed
kt3k pushed a commit that referenced this pull request Nov 17, 2023
)

Migrate to use `Promise.withResolvers()` instead of `deferred` in some
of the tests in `cli/tests/unit/`.
Issue: #21041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants