Skip to content
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

feat!: rename mock types to match jest's #1525

Merged
merged 3 commits into from Jun 24, 2022

Conversation

sheremet-va
Copy link
Member

Current types were names without much consideration about compatibility with Jest, or any actual thought behind it 👀

I think we might as well align them with Jest. This is a breaking change

@netlify
Copy link

netlify bot commented Jun 22, 2022

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9feccf0
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/62b4090a74b53400086ce9bd
😎 Deploy Preview https://deploy-preview-1525--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu
Copy link
Member

antfu commented Jun 22, 2022

Maybe we could do type alias like:

export type MockContext = SpyContext

@sheremet-va
Copy link
Member Author

sheremet-va commented Jun 22, 2022

Maybe we could do type alias like:

export type MockContext = SpyContext

What would be the benefit? Avoid breakage? Again, the current names were chosen on a whim 😄 We can support both, but I don't see a reason, tbh 👀

@antfu
Copy link
Member

antfu commented Jun 22, 2022

We have SpyInstanceFn renamed to Mock, but kept SpyInstance, which feels a bit inconsistent to me. Should we also rename it, or we just have two set of naming logic.

@sheremet-va
Copy link
Member Author

We have SpyInstanceFn renamed to Mock, but kept SpyInstance, which feels a bit inconsistent to me. Should we also rename it, or we just have two set of naming logic.

jest has SpyInstance 😄 I've added an alias for MockInstance, since jest also has that one.

@sheremet-va sheremet-va merged commit 223e81c into vitest-dev:main Jun 24, 2022
@sheremet-va sheremet-va deleted the fix/rename-types branch June 24, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants