Packages

@testing-library/jest-dom

8.0.0 · 19 Nov 2026MIT104.4M / weekRepositoryHomepagenpmAtom feed

Your version

6.0.0

major13 Aug 2023Where it was published

6.10.0 is the newest release of 6.x.

In short

6 breaking1 new

  • Breaking

    Removes the extend-expect script. Users should use the default import path or one of the new test platform-specific paths to automatically extend the appropriate "expect" instance.

  • Breaking

    @testing-library/jest-dom - jest (@types/jest)

  • Breaking

    @testing-library/jest-dom/jest-globals - @jest/globals

  • Breaking

    @testing-library/jest-dom/vitest - vitest

  • Breaking

    Update kcd-scripts

  • Breaking

    Drop node < 14

Release note

Features

  • Local types, supporting jest, @jest/globals, vitest

Breaking changes

  • Breaking

    Removes the extend-expect script. Users should use
    the default import path or one of the new test platform-specific
    paths to automatically extend the appropriate "expect" instance.

extend-expect was not documented in the Readme, so this change should
have minimal impact.

Users can now use the following import paths to automatically extend
"expect" for their chosen test platform:

  • Breaking

    @testing-library/jest-dom - jest (@types/jest)

  • Breaking

    @testing-library/jest-dom/jest-globals - @jest/globals

  • Breaking

    @testing-library/jest-dom/vitest - vitest

For example:

import '@testing-library/jest-dom/jest-globals'

Importing from one of the above paths will augment the appropriate
matcher interface for the given test platform, assuming the import
is done in a .ts file that is included in the user's tsconfig.json.

It's also (still) possible to import the matchers directly without
side effects:

import * as matchers from '@testing-library/jest-dom/matchers'

  • Breaking

    Update kcd-scripts

  • Breaking

    Drop node < 14

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.