'Cant find setup() on userEvent
I am trying to use the user-event utility in testing library as described here :
https://testing-library.com/docs/user-event/intro
Unfortunatley when I try and call the setup function
userEvent.setup()
My IDE says that it cannot be found :
Why is this happening?
My import in my file looks like this :
import userEvent from '@testing-library/user-event'
And my package dependencies look like this :
"@testing-library/dom": "^8.11.3",
"@testing-library/jest-dom": "5.7.0",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.5.0",
Solution 1:[1]
The userEvent.setup() API is added in v14.0.0
There is a note in the doc user-event/intro
These docs describe user-event@14.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | slideshowp2 |

