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

chore: 🏷️ Use generic return type for all jest matchers #655

Merged
merged 1 commit into from
Apr 30, 2024
Merged

chore: 🏷️ Use generic return type for all jest matchers #655

merged 1 commit into from
Apr 30, 2024

Conversation

pcbowers
Copy link
Contributor

@pcbowers pcbowers commented Apr 29, 2024

This better aligns with jest documentation: https://archive.jestjs.io/docs/en/23.x/expect#expectextendmatchers and ensures that types can work properly with other jest extension libraries like jest-chain.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently, when another library is used that modifies the return type of a matcher, all custom matchers added by spectator cannot be overridden in TypeScript because they do not use the R generic. This fixes that problem.

Issue Number: N/A

What is the new behavior?

All custom matchers now use the R generic instead of boolean.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

 This better aligns with jest documentation: https://archive.jestjs.io/docs/en/23.x/expect#expectextendmatchers and ensures that types can work properly with other jest extension libraries like jest-chain.
Copy link

stackblitz bot commented Apr 29, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal NetanelBasal merged commit f322a65 into ngneat:master Apr 30, 2024
3 checks passed
@pcbowers pcbowers deleted the patch-1 branch April 30, 2024 12:14
@pcbowers
Copy link
Contributor Author

@NetanelBasal What does the release schedule look like for this library? Is there an estimate of when this will be available in a given version?

@NetanelBasal
Copy link
Member

Done

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.

2 participants