You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which I think is quite unexpected. I believe it should only happen when using the deepMock function.
Also, it break some built-in object (Map, Set, Date, etc) as seen in #59.
Is it the expected behavior?
The text was updated successfully, but these errors were encountered:
Found a way out to prevent unintentional deep mocks. You can put the mock implementation inside Object.create function, which makes the keys non enumerable, thus the mock function won't be able to iterate its keys and do deep mocks.
Beraliv
pushed a commit
to Beraliv/jest-mock-extended
that referenced
this issue
May 1, 2024
Hi!
When passing a mock implementations to
mock
, every sub object get wrapped in a Proxy. For example,Which I think is quite unexpected. I believe it should only happen when using the
deepMock
function.Also, it break some built-in object (Map, Set, Date, etc) as seen in #59.
Is it the expected behavior?
The text was updated successfully, but these errors were encountered: