-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Extend CustomMatcher instead of just functions #14050
Comments
Loosely referenced in #4711 (comment) |
I think this is good idea. It should be possible to make Another approach could be adding something like Would you be interested to open a PR to see how actual implementation could look like? |
Yeah why not. My thoughts were to change Won't have too much time right now but I'll eventually get around to this. (Anyone watching at home feel free to take this on) |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
1 similar comment
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
馃殌 Feature Proposal
My goal is to create a better
Buffer
matcher. One that will show the diff by bytes and also diff by the encoded string.Unfortunately when I use it as an
AsymmetricMatcher
the format is generic.I investigated but it doesn't seem like I have control of this string. https://github.com/facebook/jest/blob/main/packages/expect/src/jestMatchersObject.ts#L105
I'm not sure if this is the best approach but allowing developers to specify their own
AsymmetricMatcher
subclass would give us more control.Motivation
This will allow
jest-extended
to have nicer messages for their AsymmetricMatchers.Of course my use case will be improved as well.
Example
No response
Pitch
It doesn't seem possible to get this functionality by
expect.extend
or other avenues.The text was updated successfully, but these errors were encountered: