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
My guess for the issue is that mock uses an empty object as a default first argument, which has the toString default js method, and that causes jest-mock-extended not to generate a jest.fn for it.
FWIW, it can be worked around by just providing a different toString to the default implementation:
constfoo=mock<Foo>({toString: ()=>'bar',});
The text was updated successfully, but these errors were encountered:
The following fails with a
TypeError: foo.toString.mockReturnValue is not a function
:My guess for the issue is that
mock
uses an empty object as a default first argument, which has thetoString
default js method, and that causesjest-mock-extended
not to generate ajest.fn
for it.FWIW, it can be worked around by just providing a different
toString
to the default implementation:The text was updated successfully, but these errors were encountered: