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

False positive for Async assertions and ternary operator #832

Closed
jhunterkohler opened this issue Apr 25, 2021 · 4 comments · Fixed by #833
Closed

False positive for Async assertions and ternary operator #832

jhunterkohler opened this issue Apr 25, 2021 · 4 comments · Fixed by #833

Comments

@jhunterkohler
Copy link

Eslint is giving me this error:

Async assertions must be awaited or returned. (jest/valid-expect)

upon the following code (just the second clause of ternary operators):

carbon (2)

The script is included in my config's setupAfterEnv list.

The error is obviously either

  1. I'm an idiot
  2. Those are being returned and its a bug

The extensions are just a shortcut macro to have rejects and resolves for any value. As you can see, this can already done with expect(...).resolves.not.toThrow(), and the converse.

@G-Rath
Copy link
Collaborator

G-Rath commented Apr 25, 2021

minor nit: when creating issues could you please provide code as snippets instead of as a screenshot? it makes it a lot easier to work with 😅

@jhunterkohler
Copy link
Author

Yes, sorry, I wasn't thinking. Thank you.

@G-Rath
Copy link
Collaborator

G-Rath commented Apr 26, 2021

No problem - I'm curious to what program you used to make the screenshot, as it looks perfectly taken.

@github-actions
Copy link

🎉 This issue has been resolved in version 24.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants