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
Add vitest analog of @emotion/jest matchers without using jest types #3132
Labels
Comments
+1 |
The following serializer works fine for me:
It can be registered in
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem
I'm working to replace jest with vitest in our current codebase. I'm able to use the @emotion/jest matchers in vitest by simply
expect.extend({ ...matchers });
and it works without issue. However, during build and typechecking, it is failing as the jest types are no longer included in our project.Cannot find type definition file for 'jest'
, and also onSnapshotSerializerPlugin
andExpectExtendMap
.Proposed solution
Ideally a vitest compatible type definition. I don't think it needs to be a new package at all, just a new export, similar to how
@testing-library/jest-dom/vitest
is handled.Alternative solutions
I was able to stop the errors from being displayed by setting
skipLibCheck: true
in our tsconfig.json, but it is not an ideal situation.The text was updated successfully, but these errors were encountered: