Skip to content

Not compatible with jest 27 #963

Closed
Closed
@lukeapage

Description

@lukeapage
  • @testing-library/dom version: 7.31.0
  • Testing Framework and version:
    Jest 27.0.1
  • DOM Environment:
    jsdom: 16.6

What you did:

After upgrading to jest v27 I get an error:

  ● Test suite failed to run

    TypeError: Cannot destructure property 'DOMElement' of '_prettyFormat.default.plugins' as it is undefined.

      at Object.<anonymous> (node_modules/@testing-library/dom/dist/pretty-dom.js:33:3)
      at Object.<anonymous> (node_modules/@testing-library/dom/dist/config.js:11:18)

Problem description:

I believe jest's pretty-format package changed from exporting on "default" to exporting directly. Even though dom testing library requires a older version, jest requires the newer version, so when dom testing library requires it, it gets the newer version...

Suggested solution:

I can only think to publish a new major version which will not be compatible with jest 26 but will work with jest 27. I believe you just need to remove .default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions