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
Added jest matcher support for .toHaveValue() #166
base: main
Are you sure you want to change the base?
Added jest matcher support for .toHaveValue() #166
Conversation
@gnapse I'd like to add the same support to I guess this means that this PR would also remove that functionality from As it stands we wouldn't be able to switch out the implementation for |
@@ -23,7 +17,7 @@ export function toHaveValue(htmlElement, expectedValue) { | |||
const expectsValue = expectedValue !== undefined | |||
return { | |||
pass: expectsValue | |||
? isEqualWith(receivedValue, expectedValue, compareArraysAsSet) |
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.
This change would mean we can no longer match arrays regardless of order, as per my comment. But we wouldn't be able to support jest matchers without it, e.g. expect.arrayContaining(['second', 'third'])
@connormeredith sorry that this has slipped off our plate for so long. But it still sounds like an interesting path to follow. Do you have the bandwidth to resume working on this and ship it? If not that's ok. I got the gist of it and I think I can help finishing it too. Let me know and I'll plan accordingly. |
Any news on this? I have noticed that I can not use regexes to assert values with the |
Oh boy this is embarrassing. @connormeredith I'm ready to merge this. Can you take care of the merge conflict? That file needs to be removed, since types are no longer maintained by us. |
What:
Added jest matcher support for .toHaveValue().
Why:
Addressing issue on #165 and for greater flexibility in tests.
How:
Similar to #93.
Checklist: