BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

Ensure `later` / `debounce` / etc can be controlled by fake timers. #352

Closed rwjblue closed 5 years ago

rwjblue commented 5 years ago

There are a few fundamental concepts regarding the timers in Backburner.js:


This PR resolves the original bug (caching the setTimeout that is used by platform.setTimeout in module scope), and adds explicit tests using the most common "fake timers" system (lolex which is what sinon uses) to help ensure this is clearer in the future.

Fixes #351