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