Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhepper/1606967 to your computer and use it in GitHub Desktop.
Save dhepper/1606967 to your computer and use it in GitHub Desktop.
assert = require 'assert'
vows = require 'vows'
tornDown = false
vows.describe('Vows with asynchronous teardowns').addBatch
'Context with long-running teardown':
'is run first': () ->
teardown: () ->
setTimeout(() =>
tornDown = true
@callback()
return
, 1000)
return
.addBatch
'The next batch':
'is not run until the teardown is complete': () ->
assert.ok tornDown
.export module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment