-
Notifications
You must be signed in to change notification settings - Fork 144
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
await-async-events
reports a problem when userEvent.setup
is called from another function
#818
Labels
bug
Something isn't working
Comments
dfernandez79
added
bug
Something isn't working
triage
Pending to be triaged by a maintainer
labels
Sep 25, 2023
we have same problem like below in v6.0.2 const setup = () => {
const utils = render(<SomeComponent />,);
const user = userEvent.setup(); // error, `Promise returned from async event method `user` must be handled`
return { ...utils, user};
};
...
describe('test suit', () => {
it('case', async () => {
const user = userEvent.setup(); // no error |
We are getting a similar issue to what @shoota mentioned above, is there any different way/fix for doing this? |
1 task
1 task
Done. This should be fixed in v6.1.2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you read the Troubleshooting section?
Yes
Plugin version
v6.0.2
ESLint version
v8.50.0
Node.js version
18.18.0
package manager and version
npm 9.8.1
Operating system
macOS Ventura 13.5.2 (22G91)
Bug description
The rule
await-async-events
withPromise returned from
setUpUserEventswrapper over async event method must be handled
when I calluserEvent.setup()
fromsetUpUserEvents
.Example:
Steps to reproduce
userEvent.setup()
await-async-events
(all ok)userEvent.setup()
into another functionawait-async-events
(eslint fails)Error output/screenshots
Before the refactor:
After the refactor (eslint error):
Eslint error:
ESLint configuration
I'm extending AirBnb rules with:
Rule(s) affected
testing-library/await-async-events
Anything else?
The PR #817 is checking for the name
setup
.Maybe that isn't enough.
Do you want to submit a pull request to fix this bug?
No
The text was updated successfully, but these errors were encountered: