User-event: bug: TypeError: (0 , _dom.getConfig) is not a function

Created on 25 Jun 2020  路  6Comments  路  Source: testing-library/user-event

  • @testing-library/user-event version: 12.0.9
  • Testing Framework and version: React Testing Library v10.4.3
  • jest: v26.1.0
  • DOM Environment: jsdom v16 (default one from jest)

What you did:
I just bumped user-event from 12.0.7 to 12.0.9

What happened:
I'm getting TypeError: (0 , _dom.getConfig) is not a function when using userEvent.click in tests that were passing using v12.0.7

image

All 6 comments

Hi @Belco90 馃憢 sorry for the trouble.

The peerDepenency of this project requires you have a more recent version of DOM Testing Library installed. That's not new. You'll need to upgrade DOM Testing Library.

Mmm ok installing DOM Testing Library individually solved the problem. I didn't realize this was a peer dependency, I guess the doc could clarify this as it looks enough just having it as dependency from React Testing Library.

We've added it to the installation instructions recently

My bad I guess, as I didn't check installation instructions because it was already installed.

Could this error be updated to better indicate the fix ?

If you're not sure if your peer dependencies are met, you can simply run npm install. I don't think the library should be responsible for making sure it's installed properly, as that's typically done by the package manager.

Was this page helpful?
0 / 5 - 0 ratings