jest-dom icon indicating copy to clipboard operation
jest-dom copied to clipboard

fix: add vitest import when extending vitest matchers

Open InfiniteXyy opened this issue 1 year ago • 0 comments

What: https://github.com/testing-library/jest-dom/issues/645 Fix a vitest typing issue when using global mode

Why: If there is no import of "vitest" in the whole project (for example, vitest is in globalMode), the type merging might not work.

How: By adding an import of "vitest" when extending the matcher type

reference: https://vitest.dev/guide/extending-matchers.html

Checklist:

  • [ ] Documentation
  • [ ] Tests
  • [x] Updated Type Definitions
  • [ ] Ready to be merged

InfiniteXyy avatar Oct 18 '24 04:10 InfiniteXyy