Skip to content

Instantly share code, notes, and snippets.

@SergXIIIth
Last active December 22, 2015 05:49
Show Gist options
  • Save SergXIIIth/6426527 to your computer and use it in GitHub Desktop.
Save SergXIIIth/6426527 to your computer and use it in GitHub Desktop.
Jasmine sleep function. Helpful to wait until DOM events handled.
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