-
Notifications
You must be signed in to change notification settings - Fork 251
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
Cannot import userEvent after installing user-event #1068
Cannot import userEvent after installing user-event #1068
Comments
Please dear god someone put this line in the docs:
|
Oh my god thank you! I was going insane. |
My VS code also added |
using import {userEvent} better than using import userEvent |
if this is a question you asking then i think these are two different imports, without the braces one is the import for the default that's being exported from the package and with the |
I am trying to install user-event using the install instructions available here and then call
userEvent.setup()
per the instructions here. However, it is not importing and I feel like I'm missing something blindingly obvious.To Reproduce Steps to reproduce the behavior:
npx create-react-app .
npm install --save-dev @testing-library/react @testing-library/dom @testing-library/user-event
import {userEvent} from '@testing-library/user-event';
Expected behavior
I expect, on installing
@testing-library/user-event
to be able to import userEvent and have it be defined. It is not.Screenshots If applicable, add screenshots to help explain your problem.
My full test file:
Default
App.js
:Desktop (please complete the following information):
Additional context
I'm following the same pattern I used to install all my other npm modules, and have only been using this library for the last 2 days. The fact that I can't even import a module out of the box that's referred to in the docs seems weird. If I'm importing it from the wrong location it's because the examples in the docs do not have an explicit "import" statement to access the userEvent object.
The text was updated successfully, but these errors were encountered: