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
Underscore 1.6.0 to 1.8.3 stores Date.now, mandating Date.now to be stubbed before loading Underscore for fake clocks to work. Affected functions include _.debounce, _.throttle, and probably more.
This is an issue with Underscore, not Lolex. Lolex can work around this by replacing Date.now upon installation, but this will end up faking Dates created before installation and end up breaking other, more valid, uses.
Underscore no longer uses Date.now in master, and lodash seems to work as well. This issue is just here for informational purposes.
The text was updated successfully, but these errors were encountered:
danny-wu
changed the title
Date.now() is incremented after setTimeouts have run.
Underscore's stores Date.now(), and Lolex cannot replace it
Apr 1, 2016
Underscore
1.6.0
to1.8.3
storesDate.now
, mandatingDate.now
to be stubbed before loading Underscore for fake clocks to work. Affected functions include_.debounce
,_.throttle
, and probably more.This is an issue with Underscore, not Lolex. Lolex can work around this by replacing
Date.now
upon installation, but this will end up fakingDate
s created before installation and end up breaking other, more valid, uses.Underscore no longer uses
Date.now
inmaster
, andlodash
seems to work as well. This issue is just here for informational purposes.The text was updated successfully, but these errors were encountered: