-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Description
In v1.12.1, it seems the debounce method has changed to use now(), which holds onto a reference to whatever Date.now was when underscore was loaded the first time.
This has caused problems in our jest tests, where we're using jest.useFakeTimers to mock changes in time to test timeouts and suchlike, because any mocked changes to the date functions won't have any effect.
Looking at the tests added at the same time, it seems this was perhaps intentional? If so, I think it's possibly not a suitable change for a .1 patch release, as it'll break anything that was relying on mocking the current time - which I suspect is a reasonably common use case in tests. (Ok, maybe not that common, but not totally out there...)
Thanks!
katerberg and nikolalsvk