Created
July 12, 2017 02:26
-
-
Save khaosdoctor/a4bf17871de5e6a17718eba7ec7e7b96 to your computer and use it in GitHub Desktop.
Fake timer example
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
{ | |
setUp: function () { | |
this.clock = sinon.useFakeTimers(); | |
}, | |
tearDown: function () { | |
this.clock.restore(); | |
}, | |
describe('Deve usar um timmer de 510ms fixo', (assert) => { | |
var el = jQuery("<div></div>"); | |
el.appendTo(document.body); | |
el.animate({ height: "200px", width: "200px" }); | |
this.clock.tick(510); | |
assertEquals("200px", el.css("height")); | |
assertEquals("200px", el.css("width")); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment