Skip to content

Instantly share code, notes, and snippets.

@dhepper
Created January 13, 2012 15:31
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/1606988 to your computer and use it in GitHub Desktop.
Save dhepper/1606988 to your computer and use it in GitHub Desktop.
vows = require('vows');
assert = require('assert');
vows.describe("Vows with asynchonous teardowns").addBatch({
"Context with long-running teardown": {
"is run first": function () {},
teardown: function () {
var callback = this.callback;
setTimeout(function () {
tornDown = true;
callback();
}, 100);
}
}
}).addBatch({
"The next batch": {
"is not run until the teardown is complete": function () {
assert.ok(tornDown);
}
}
}).export(module);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment