UNPKG

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