Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1 KB

install.mdx

File metadata and controls

46 lines (34 loc) · 1 KB
id title
install
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-event
yarn add --dev @testing-library/user-event

Now 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.