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
Quick question: can I somehow use testdouble to mock out Date? I mean a similiar functionality to sinon fake timers. I tried few approaches with td but it didn't work out 😢
The text was updated successfully, but these errors were encountered:
I can’t speak to precisely why testdoublecan’t do what you’re trying to do.
But if you haven’t looked at it before, I might suggest looking at the contributing-tests wiki, specifically “Don’t mock what you don’t own”. That whole page is worth reading for the background (and it’s not very long), but the last section suggests a way forward: putting your use of Date in your own wrapper, which you can then design for easy use/mocking.
Quick question: can I somehow use
testdouble
to mock outDate
? I mean a similiar functionality to sinon fake timers. I tried few approaches withtd
but it didn't work out 😢The text was updated successfully, but these errors were encountered: