testing-library / jest-dom

:owl: Custom jest matchers to test the state of the DOM
https://testing-library.com/docs/ecosystem-jest-dom
MIT License
4.45k stars 401 forks source link

fix: add vitest import when extending vitest matchers #646

Closed InfiniteXyy closed 3 weeks ago

InfiniteXyy commented 1 month ago

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:

github-actions[bot] commented 3 weeks ago

:tada: This PR is included in version 6.6.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

gnapse commented 3 weeks ago

@all-contributors please add @InfiniteXyy for code, bug

allcontributors[bot] commented 3 weeks ago

@gnapse

I've put up a pull request to add @InfiniteXyy! :tada: