Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martsie/7a7893dd93700932a818e80fcdd6f0ba to your computer and use it in GitHub Desktop.
Save martsie/7a7893dd93700932a818e80fcdd6f0ba to your computer and use it in GitHub Desktop.
QUnit test in CoffeeScript with multiple async assertions
QUnit.module 'Waiter class'
test 'Waiter waits for 1 second twice', (assert) ->
done1 = do assert.async
done2 = do assert.async
assert.expect 2
waiter = new Waiter()
waiter.waitAndReturn ->
ok true, 'Timer completed'
do done1
waiter.waitAndReturn ->
ok true, 'Timer completed'
do done2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment