Skip to content

Instantly share code, notes, and snippets.

@chadhietala
Created March 5, 2015 17:45
Show Gist options
  • Select an option

  • Save chadhietala/9c1620fe1c2a494f695d to your computer and use it in GitHub Desktop.

Select an option

Save chadhietala/9c1620fe1c2a494f695d to your computer and use it in GitHub Desktop.
Async Tests In QUnit 2.0
var QUnit = require('qunitjs');
QUnit.module('foo', {
afterEach:function(assert) {
var done = assert.async();
setTimeout(function() {
done();
}, 1000);
}
});
QUnit.test('true', function(assert) {
assert.ok(true);
});
QUnit.test('false', function(assert) {
var done = assert.async();
setTimeout(function() {
assert.ok(!false);
done();
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment