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