We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Importing or re-exporting and then using user event from '@testing-library/user-event' leads to an error.
Importing: import user from '@testing-library/user-event' or re-exporting
import user from '@testing-library/user-event'
export { renderWithProviders as render, userEvent as user };
Then use it in a test:
user.click(someElement)
System: OS: macOS 12.1 CPU: (8) arm64 Apple M1 Pro Memory: 151.58 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm Browsers: Brave Browser: 96.1.33.106 Chrome: 96.0.4664.110 Safari: 15.2 npmPackages: @vitejs/plugin-react-refresh: ^1.3.6 => 1.3.6 vite: 2.7.4 => 2.7.4 vitest: 0.0.102 => 0.0.102
npm
TypeError: __vite_ssr_import_2__.user.click is not a function
The text was updated successfully, but these errors were encountered:
It worked by adding @testing-library/user-event to inline deps:
test: { deps: { inline: ['@testing-library/user-event'] } }
Sorry, something went wrong.
default
Caused by testing-library/user-event#813
Should be fixed in 0.0.120
No branches or pull requests
Describe the bug
Importing or re-exporting and then using user event from '@testing-library/user-event' leads to an error.
Reproduction
Importing:
import user from '@testing-library/user-event'
or re-exporting
Then use it in a test:
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: