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

userEvent.setup API does not return a Promise. #800

Closed
macchiitaka opened this issue Aug 14, 2023 · 2 comments · Fixed by #817 · May be fixed by WontonSam/woocommerce-admin#182 or WontonSam/woocommerce-admin#267
Closed

userEvent.setup API does not return a Promise. #800

macchiitaka opened this issue Aug 14, 2023 · 2 comments · Fixed by #817 · May be fixed by WontonSam/woocommerce-admin#182 or WontonSam/woocommerce-admin#267
Assignees
Labels
bug Something isn't working released

Comments

@macchiitaka
Copy link

Have you read the Troubleshooting section?

Yes

Plugin version

v6.0.0

ESLint version

v8.47.0

Node.js version

18.17.1

package manager and version

npm 9.6.7

Operating system

macOS Ventura, version 13.5

Bug description

The await-async-events rule expects the userEvent.setup API to return a Promise.
However, the userEvent.setup API does not return a Promise.

Steps to reproduce

  1. import userEvent from '@testing-library/user-event' module.
  2. run userEvent.setup() API.

Error output/screenshots

Screenshot 2023-08-14 at 22 59 07

ESLint configuration

.eslintrc.js

module.exports = {
  overrides: [
    
    {
      files: ['**/?(*.)+(spec|test).[jt]s?(x)'],
      extends: ['plugin:testing-library/react'],
    },
  ],
}

Rule(s) affected

await-async-events

Anything else?

No response

Do you want to submit a pull request to fix this bug?

No

@macchiitaka macchiitaka added bug Something isn't working triage Pending to be triaged by a maintainer labels Aug 14, 2023
@Belco90 Belco90 removed the triage Pending to be triaged by a maintainer label Aug 14, 2023
@Belco90 Belco90 self-assigned this Aug 28, 2023
@kevin-dev71
Copy link

check if you have a user.click or some user action that is not awaited

@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

doochik added a commit to doochik/eslint-plugin-testing-library that referenced this issue Oct 24, 2023
Belco90 added a commit that referenced this issue Nov 9, 2023
…ers (#834)

fix(await-async-events): sync userEvent.setup() should not be reported

Better fix for #800

Co-authored-by: Mario Beltrán <belco90@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment