New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): augment jest matchers #665
Conversation
Vitest expect now can see external jest libraries matchers
✔️ Deploy Preview for vitest-dev ready! 🔨 Explore the source changes: 834696f 🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/61fa23be40abaa0008504879 😎 Browse the preview: https://deploy-preview-665--vitest-dev.netlify.app |
Now we have the types, but there seems to be a problem at runtime? Because |
Can you create a reproduction? It works for me. |
Just got it working correctly. This is the repo: https://github.com/bytedance/bytemd Errors messages:
Added these lines to make it work: import { expect } from 'vitest'
import matchers from '@testing-library/jest-dom'
expect.extend(matchers) |
If you are not using |
Thanks. Got stuck by this issue for a little while, so I added a note to the documentation for the benefit of other users |
Closes #664
Vitest expect now can see external jest libraries matchers, namely
@testing-library/jest-dom
assertions are recognized when importing fromvitest
. (globalexpect
is still overriden by jest's expect)