Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 :

enter image description here

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",
like image 678
Oliver Watkins Avatar asked Nov 28 '25 16:11

Oliver Watkins


1 Answers

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.

like image 194
slideshowp2 Avatar answered Dec 02 '25 04:12

slideshowp2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!