UNPKG

905 BJavaScriptView Raw
1var test = require('../');
2
3test('Harness async test support', function (t) {
4 t.plan(3);
5
6 t.ok(true, 'sync child A');
7
8 t.test('sync child B', function (tt) {
9 tt.plan(2);
10
11 setTimeout(function () {
12 tt.test('async grandchild A', function (ttt) {
13 ttt.plan(1);
14 ttt.ok(true);
15 });
16 }, 50);
17
18 setTimeout(function () {
19 tt.test('async grandchild B', function (ttt) {
20 ttt.plan(1);
21 ttt.ok(true);
22 });
23 }, 100);
24 });
25
26 setTimeout(function () {
27 t.test('async child', function (tt) {
28 tt.plan(2);
29 tt.ok(true, 'sync grandchild in async child A');
30 tt.test('sync grandchild in async child B', function (ttt) {
31 ttt.plan(1);
32 ttt.ok(true);
33 });
34 });
35 }, 200);
36});