Skip to content

szhsin/jest-dom-extended

Repository files navigation

jest-dom-extended

Extend and patch @testing-library/jest-dom matchers

NPM bundlephobia

What does this do?

  • Patches the toHaveStyle color mismatch issue (#350)
  • Provides a drop-in update that avoids changes to test files, making it easy to remove once the issue in @testing-library/jest-dom is fixed in the future.

Install

npm install -D jest-dom-extended

Usage

Load the setup file after @testing-library/jest-dom in your test configuration.

Jest

{
  "setupFilesAfterEnv": [
    "@testing-library/jest-dom",
    "jest-dom-extended/jest"
  ]
}

Vitest

export default defineConfig({
  test: {
    setupFiles: [
      "@testing-library/jest-dom",
      "jest-dom-extended/vitest",
    ],
  },
});

About

Extend and patch @testing-library/jest-dom matchers

Topics

Resources

License

Stars

Watchers

Forks