Skip to content

Commit

Permalink
Merge pull request #98 from malandrew/nested-async-plan-noend
Browse files Browse the repository at this point in the history
Asynchronously declared nested tests w/ plan() w/o end()
  • Loading branch information
James Halliday committed Aug 16, 2014
2 parents 390c2c6 + 8b85ca8 commit 3cef0da
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/nested-async-plan-noend.js
@@ -0,0 +1,36 @@
var test = require('../');

test('Harness async test support', function(t) {
t.plan(3);

t.ok(true, 'sync child A');

t.test('sync child B', function(tt) {
tt.plan(2);

setTimeout(function(){
tt.test('async grandchild A', function(ttt) {
ttt.plan(1);
ttt.ok(true);
});
}, 50);

setTimeout(function() {
tt.test('async grandchild B', function(ttt) {
ttt.plan(1);
ttt.ok(true);
});
}, 100);
});

setTimeout(function() {
t.test('async child', function(tt) {
tt.plan(2);
tt.ok(true, 'sync grandchild in async child A');
tt.test('sync grandchild in async child B', function(ttt) {
ttt.plan(1);
ttt.ok(true);
});
});
}, 200);
});

0 comments on commit 3cef0da

Please sign in to comment.