React-testing-library: @testing-library/dom dependecy issue

Created on 24 Apr 2020  路  2Comments  路  Source: testing-library/react-testing-library

  • @testing-library/react version: 10.0.3
  • react version: 16.3.1
  • node version: 12
  • npm (or yarn) version: 1.19

What you did:

Upgraded @testing-library/dom to 7.2.1

What happened:

@testing-library/dom configure doesn't set the testIdAttribute anymore

Problem description:

There are two entries created in yarn.lock for @testing-library/dom, one for 7.1.0 (used by @testing-library/react) and one for 7.2.1

Suggested solution:

Bump @testing-library/dom dependency to 7.2.1

Most helpful comment

Oh now I see that react re-exports dom, alright, I'll avoid using them together and just import everything from react.

Thank you!

All 2 comments

You probably have a an explicit dependency on @testing-library/dom in your package.json (or another packages requires it).

Bumping it might very well cause issues in other dependency trees which is why this wouldn't be safe. It's also not maintainable since we'd need to publish new versions whenever on of our dependency gets a new release.

You need to de-duplicate this yourself. In your case removing each lockfile entry for @testing-library/dom and then running yarn should help.

Oh now I see that react re-exports dom, alright, I'll avoid using them together and just import everything from react.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

good-idea picture good-idea  路  4Comments

bdauria picture bdauria  路  4Comments

albert-olive picture albert-olive  路  3Comments

julienw picture julienw  路  4Comments

alejandronanez picture alejandronanez  路  4Comments