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'), [
|
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 | ].join('\n') + '\n');
|
26 | };
|
27 |
|
28 | test.createStream().pipe(concat(tc));
|
29 |
|
30 | test('nested without plan or end', function (t) {
|
31 | t.test('first', function (q) {
|
32 | setTimeout(function first() {
|
33 | q.ok(true);
|
34 | q.end();
|
35 | }, 10);
|
36 | });
|
37 | t.test('second', function (q) {
|
38 | setTimeout(function second() {
|
39 | q.ok(true);
|
40 | q.end();
|
41 | }, 10);
|
42 | });
|
43 | });
|
44 |
|
45 | });
|