Closed moll closed 5 years ago
Verified! The standard is strange :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think the stale bot is too eager here.
Hey,
I believe Lolex deviates from the JavaScript standard behavior with regards to what
Date()
returns. I noticed this through a bug in my code that passed all tests, yet failed in production: I was creating a new date withoutnew
—Date(2015, 5, 18)
. In tests, that was equivalent tonew Date(..)
, but without mocking, it returns the current time as a string — an entirely different result. It seems to be an issue already since the times of Sinon v1.17.7 and possibly earlier. Here's an example from RunKit https://runkit.com/embed/delfomea61tm with Lolex v4.1.