Add vitest analog of @emotion/jest matchers without using jest typesΒ #3132
Description
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 on SnapshotSerializerPlugin
and ExpectExtendMap
.
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.