1 | 'use strict';
|
2 |
|
3 | var tape = require('../');
|
4 | var tap = require('tap');
|
5 | var concat = require('concat-stream');
|
6 |
|
7 | tap.test('nested sync test without plan or end', function (tt) {
|
8 | tt.plan(1);
|
9 |
|
10 | var test = tape.createHarness();
|
11 | var tc = function (rows) {
|
12 | tt.same(rows.toString('utf8').split('\n'), [
|
13 | 'TAP version 13',
|
14 | '# nested without plan or end',
|
15 | '# first',
|
16 | 'ok 1 should be truthy',
|
17 | '# second',
|
18 | 'ok 2 should be truthy',
|
19 | '',
|
20 | '1..2',
|
21 | '# tests 2',
|
22 | '# pass 2',
|
23 | '',
|
24 | '# ok',
|
25 | ''
|
26 | ]);
|
27 | };
|
28 |
|
29 | test.createStream().pipe(concat(tc));
|
30 |
|
31 | test('nested without plan or end', function (t) {
|
32 | t.test('first', function (q) {
|
33 | setTimeout(function first() {
|
34 | q.ok(true);
|
35 | q.end();
|
36 | }, 10);
|
37 | });
|
38 | t.test('second', function (q) {
|
39 | setTimeout(function second() {
|
40 | q.ok(true);
|
41 | q.end();
|
42 | }, 10);
|
43 | });
|
44 | });
|
45 |
|
46 | });
|