Open s-montigny-desautels opened 3 years ago
I have the same issue when trying to work with rxjs. This method seems to be the problem
This is a major issue for all my use cases, which has circular references which lead to infinite loop when I use with mock
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.
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?