[solved] setTimeout not working/firing in specs/tests


#21

This is awesome news (to me)! Thank you for sharing.


#22

For anyone that wants to use Jasmine 2 I created atom-jasmine2-test-runner.

With atom-jasmine2-test-runner you can choose which helpers you want to include.

The mockClock helper will mock setTimeout, setInterval, and Date.now() like in Atom’s spec-helper.js.

The way Atom uses to get around this is to call jasmine.useRealClock() to unSpy all of the mocked clock functions or use window.advanceClock(ms) to artificially advance the mocked clock and call the setTimeout/setInterval function without actually waiting for the timeout.