Skip to content

Commit 370b6fb

Browse files
committed
update test/nested-sync-noplan-noend.js to use concat-stream instead of tap.createConsumer (no longer available) tape-testing#312
1 parent c68c34c commit 370b6fb

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

test/nested-sync-noplan-noend.js

+17-21
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
var tape = require('../');
22
var tap = require('tap');
3-
var trim = require('string.prototype.trim');
3+
var concat = require('concat-stream');
44

55
tap.test('nested sync test without plan or end', function (tt) {
66
tt.plan(1);
77

88
var test = tape.createHarness();
9-
var tc = tap.createConsumer();
9+
var tc = function (rows) {
1010

11-
var rows = [];
12-
tc.on('data', function (r) { rows.push(r) });
13-
tc.on('end', function () {
14-
var rs = rows.map(function (r) {
15-
if (r && typeof r === 'object') {
16-
return { id : r.id, ok : r.ok, name : trim(r.name) };
17-
}
18-
else return r;
19-
});
11+
var rs = rows.toString('utf8').split('\n');
2012
var expected = [
2113
'TAP version 13',
22-
'nested without plan or end',
23-
'first',
24-
{ id: 1, ok: true, name: 'should be truthy' },
25-
'second',
26-
{ id: 2, ok: true, name: 'should be truthy' },
27-
'tests 2',
28-
'pass 2',
29-
'ok'
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+
''
3026
]
3127
tt.same(rs, expected);
32-
});
28+
};
3329

34-
test.createStream().pipe(tc);
30+
test.createStream().pipe(concat(tc));
3531

3632
test('nested without plan or end', function(t) {
3733
t.test('first', function(q) {

0 commit comments

Comments
 (0)