-
-
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
Docs: Migrate mockedStore typings to vitest v2 #2759
Conversation
Migrate the typings of `mockedStore` to the changes of >[email protected]: see: https://vitest.dev/guide/migration#simplified-generic-types-of-mock-functions-e-g-vi-fn-t-mock-t https://github.com/vitest-dev/vitest/releases/tag/v2.0.0
✅ Deploy Preview for pinia-playground canceled.
|
✅ Deploy Preview for pinia-official ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -191,7 +191,7 @@ function mockedStore<TStoreDef extends () => unknown>( | |||
...args: infer Args | |||
) => infer ReturnT | |||
? // 👇 depends on your testing framework | |||
Mock<Args, ReturnT> | |||
Mock<(args: Args) => ReturnT> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although now it should be able to just take Actions[K]
. I need to test it
@@ -191,7 +191,7 @@ function mockedStore<TStoreDef extends () => unknown>( | |||
...args: infer Args | |||
) => infer ReturnT | |||
? // 👇 depends on your testing framework | |||
Mock<Args, ReturnT> | |||
Mock<(args: Args) => ReturnT> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
Mock<(args: Args) => ReturnT> | |
Mock<(...args: Args) => ReturnT> |
Update docs to migrate the typings of
mockedStore
to the changes of >[email protected]:see:
https://vitest.dev/guide/migration#simplified-generic-types-of-mock-functions-e-g-vi-fn-t-mock-t
https://github.com/vitest-dev/vitest/releases/tag/v2.0.0