-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TypeScript errors when mocking overloaded functions #6182
Labels
Comments
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I found #6085 and have a very similar issue.
So I thought it would have been solved by #6086. But unfortunately I'm still running into issues.
This actually looks to be a regression introduced with 2.0.3
Here it is without any TS errors with 2.0.2 https://stackblitz.com/edit/vitest-dev-vitest-vmu2hy?file=test%2Fbasic.test.ts
And here it is with 2.0.3: https://stackblitz.com/edit/vitest-dev-vitest-huxpgg?file=test%2Fbasic.test.ts
This is my code (also available at the above StackBlitz links)
(With inlined error messages)
And in text form, for easier Google indexing:
With
string
Error:
Trying
Buffer
instead, as that's what suggested by the error messageError:
Trying the combination of
Buffer | string
as that's what the actual implementation hasError:
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-huxpgg?file=test%2Fbasic.test.ts
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: