-
Notifications
You must be signed in to change notification settings - Fork 389
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
fix: matchers type is making the global expect unsafe #513
Conversation
This is great, thank you for porting over the type tests. I'm going to test out these changes in my test repos tomorrow and then merge |
Codecov Report
@@ Coverage Diff @@
## main #513 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 664 664
Branches 251 251
=========================================
Hits 664 664 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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 @kryops. I pushed a couple of commits to make this compatible with all 3 test platforms that we support and split/duplicated the type tests as such. It actually helped catch an issue with the @jest/globals
interface definition.
Also enabled running the type tests in CI.
🎉 This PR is included in version 6.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@all-contributors add @kryops for bug code test |
@nickmccurdy I've put up a pull request to add @kryops! 🎉 |
@all-contributors add @kryops for bug code test |
I've put up a pull request to add @kryops! 🎉 |
What:
Port of DefinitelyTyped/DefinitelyTyped#66247, after the types moved here in #511
Why:
See DefinitelyTyped/DefinitelyTyped#64858
How:
Moved the
Record<string, any>
constraint to thematchers
export only, and removed it from the interface that augments the global Jest matchers.Checklist:
I added a file with the TypeScript test cases from DefinitelyTyped, as they safeguard that the types should work correctly and prevent this issue from regressing. If they shouldn't be part of this repo, feel free to drop the last commit.