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

docs: return promise in async test example #15439

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cdoublev
Copy link

@cdoublev cdoublev commented Jan 9, 2025

Summary

The callback of the test example for expect.assertions() is failing because it does not return a promise.

Alternatively, the description below the test could say:

The expect.assertions(2) call ensures that both callbacks actually get called. It will fail in the example above, because the promise is not returned therefore Jest will not wait for doAsync() to run the callbacks.

Test plan

Copy link

linux-foundation-easycla bot commented Jan 9, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Jan 9, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 92499b3
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/677fa8719f74d90008d087ff
😎 Deploy Preview https://deploy-preview-15439--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant