marchaos / jest-mock-extended

Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
MIT License
828 stars 57 forks source link

fix(calledWith) prevent falsy jestAsymmetricMatcher detection for Mock #75

Closed s-montigny-desautels closed 2 years ago

s-montigny-desautels commented 2 years ago

If a mock was passed to the calledWith function as an argument, it was falsely detected as a Jest Asymmetric Matcher.

This PR change this by using the in keyword, which does not trigger the proxy.

A test has been added to demonstrate the new behavior.