Open TimothyJones opened 1 year ago
"Hooks" section in migration guide literally mentions what you need to do in this case.
It was also changed quite some time ago not to throw an error if something either than a function is returned. I don't see the Vitest version in your issue template (which is actually required).
Just now understood what the issue is talking about 🤦♂️
Changing the type to unknown
should be fine.
Apologies, perhaps I wasn't clear with the way I worded the description.
I'm reporting it on behalf of another user (see linked issue), but I checked the source and it seems current, so I guess 0.29.8. Apologies for not including this.
I don't see the issue I'm asking about mentioned in the hooks section here - but that might have been before you realised what I was asking.
I'd be happy to send a PR updating the type.
Raised #3147
Describe the bug
On the front page of the documentation, it says that it's "Jest Compatible".
However, the type for a vitest
TestFunction
is() => Awaitable<void>
.But, in Jest the corresponding part of their
ProvidesCallback
type is() => Promise<unknown>
.This matters in
beforeEach
andafterEach
, where you might quite reasonably call a setup promise which happens to return a value that you don't care about.I think there are two possible fixes:
Awaitable<unknown>
(side note: I think the note on the front page suggests that it would be fully jest compatible with no changes).
Reproduction
System Info
Used Package Manager
npm
Validations