Created
August 6, 2014 12:47
-
-
Save yorkie/2a4083f222caabb32b09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sinon = require('sinon'); | |
var clock = sinon.useFakeTimer(); | |
setTimeout(function timer() { | |
console.log('...') | |
}, 1000); | |
// if we set: | |
clock.tick(1000); // timer will be called | |
// if we set: | |
clock.tick(999); // timer will not be called |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment