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: move matcher types to Vi namespace #608

Merged
merged 3 commits into from Jan 22, 2022
Merged

feat: move matcher types to Vi namespace #608

merged 3 commits into from Jan 22, 2022

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jan 22, 2022

I am using Vi namespace since as I saw from others in discord, this is preferred way to use vitest

@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for vitest-dev ready!

🔨 Explore the source changes: 2ad0d05

🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/61ebf346a3a82a00086901a8

😎 Browse the preview: https://deploy-preview-608--vitest-dev.netlify.app

@@ -16,8 +16,6 @@ export * from './integrations/vi'
export * from './types'
export * from './api/types'

export type { Spy, SpyFn } from 'tinyspy'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are internal types

namespace Chai {
interface ExpectStatic extends AsymmetricMatchersContaining {
<T>(actual: T, message?: string): VitestAssertion<T>
namespace Vi {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allows for:

namespace Vi {
   interface Assertion {
      customerAssertion(): void;
   }
}

chai augmentations should still work

namespace Chai {
   interface Assertion {
      customerAssertion(): void;
   }
}

Vi.Assertion['customerAssertion'] // exists

@antfu antfu merged commit 64f07e2 into main Jan 22, 2022
@antfu antfu deleted the sheremet-va/types branch January 22, 2022 23:05
chaii3 pushed a commit to chaii3/vitest that referenced this pull request May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants