You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling expect.getState().currentTestName Jest will return a string in the format:
`${describeTitle} ${testTitle}`
Whereas Vitest will produce:
`{filePath} > ${describeTitle} > ${testTitle}`
Although I prefer what Vitest produces, the inconsistency is causing issue with a jest matcher library jest-image-snapshot which relies on this API for generating filenames for snapshot image files. Migrating from jest to vitest is breaking my tests as the filenames being generated are too long resulting in a ENAMETOOLONG error.
My proposal would be to make this API consistent with Jest, and offer this richer output on a separate API (e.g. currentTestFullName).
Finally, I'm raising this as a bug as Vitest advertises itself as "Jest Compatible". This is an example that clearly breaks that contract.
Finally, I'm raising this as a bug as Vitest advertises itself as "Jest Compatible".
We have the whole migration page in docs for people moving away from Jest, we are compatible to the point it makes sense for us. It's been two years since the API you mentioned was implemented (and it's used in reporters, for example) and it might break other libraries that Vitest users rely on.
I'd say this qualifies as a separate section in the migration guide.
Describe the bug
When calling
expect.getState().currentTestName
Jest will return a string in the format:Whereas Vitest will produce:
Although I prefer what Vitest produces, the inconsistency is causing issue with a jest matcher library
jest-image-snapshot
which relies on this API for generating filenames for snapshot image files. Migrating from jest to vitest is breaking my tests as the filenames being generated are too long resulting in aENAMETOOLONG
error.My proposal would be to make this API consistent with Jest, and offer this richer output on a separate API (e.g.
currentTestFullName
).Finally, I'm raising this as a bug as Vitest advertises itself as "Jest Compatible". This is an example that clearly breaks that contract.
Relates to #297
Reproduction
Reproduction not necessary.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: