Last active
December 22, 2015 05:49
-
-
Save SergXIIIth/6426527 to your computer and use it in GitHub Desktop.
Jasmine sleep function. Helpful to wait until DOM events handled.
This file contains 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
window.sleep = (ms, and_runs) -> | |
flag = false | |
runs -> | |
setTimeout -> | |
flag = true | |
, ms | |
waitsFor -> | |
flag | |
, "Sleep", ms + 100 | |
runs -> and_runs() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment