Skip to content

Commit

Permalink
Add test for async asserts in subtests ref #42
Browse files Browse the repository at this point in the history
It passes on this branch with no changes, w00t
  • Loading branch information
grncdr authored and James Halliday committed Oct 25, 2013
1 parent 8b59a80 commit 9d64ad3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/subtest_and_async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var test = require('../');

var asyncFunction = function (callback) {
setTimeout(callback, Math.random * 50);
};

test('master test', function (t) {
t.test('subtest 1', function (t) {
t.pass('subtest 1 before async call');
asyncFunction(function () {
t.pass('subtest 1 in async callback');
t.end();
})
});

t.test('subtest 2', function (t) {
t.pass('subtest 2 before async call');
asyncFunction(function () {
t.pass('subtest 2 in async callback');
t.end();
})
});
});

0 comments on commit 9d64ad3

Please sign in to comment.