| id | install |
|---|---|
| title | Installation |
import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem'
<Tabs defaultValue="npm" values={[ { label: 'npm', value: 'npm' }, { label: 'Yarn', value: 'yarn' }, ]}>
npm install --save-dev @testing-library/user-eventyarn add --dev @testing-library/user-eventNow simply import it in your tests:
import userEvent from '@testing-library/user-event'
// or
const {default: userEvent} = require('@testing-library/user-event')Note that @testing-library/user-event requires @testing-library/dom.
If you use one of the
framework wrappers, it is
important that @testing-library/dom is resolved to the same installation
required by the framework wrapper of your choice.
Usually this means that if you use one of the framework wrappers, you should not
add @testing-library/dom to your project dependencies.