sindresorhus / debounce

Delay function calls until a set time elapses after the last invocation
Other
798 stars 80 forks source link

Usage of 'date-now' actually makes this harder to test with Jasmine #5

Closed guncha closed 1 year ago

guncha commented 9 years ago

Due to how date-now gets a reference to the Date.now function at initialization time, it cannot be overridden when using jasmine.clock().install(). It works with module level mocking, but sometimes that's a bit of an overkill.

AdamBoxall commented 8 years ago

+1

Ssame problem with sinon's fake timers.

JoshuaKGoldberg commented 6 years ago

22 would help with this.

sindresorhus commented 1 year ago

date-now is no longer used.

JoshuaKGoldberg commented 1 year ago

Ha, I'd totally forgotten about this - thanks for the followup!