Closed nlkluth closed 4 years ago
Have also been hitting this bug, would love to see it get merged and make it to a release.
if (!(property in obj)) {
as suggested in #4 might be an even more robust solution.
@laurence-hudson-mindfoundry Good call 👍 Made the change. Let me know if it matches your expectations!
Hey @nlkluth can you take a look at the conflicts.
@marchaos Thanks for knocking that out for me 👍
👋 Thanks for you work on this library! I noticed that I cannot set boolean values due to the conditional statement checking for falsey values.
Related Issues
I believe https://github.com/marchaos/jest-mock-extended/issues/30 would be fixed by this change. It appears as though the author is running into the same scenario I did.
The Fix
I changed the condition to check only for undefined, which would allow boolean and null values to be used.
Let me know if there is anything you'd like me to adjust! Thanks 🙌