Skip to content

Commit 771e411

Browse files
committed
update test/too_many.js to use concat-stream instead of tap.createConsumer (no longer available in latest tap) tape-testing#312
1 parent 453bd55 commit 771e411

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

test/too_many.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
var falafel = require('falafel');
22
var tape = require('../');
33
var tap = require('tap');
4-
var trim = require('string.prototype.trim');
4+
var concat = require('concat-stream');
55

66
tap.test('array test', function (tt) {
77
tt.plan(1);
88

99
var test = tape.createHarness({ exit : false });
10-
var tc = tap.createConsumer();
11-
12-
var rows = [];
13-
tc.on('data', function (r) { rows.push(r) });
14-
tc.on('end', function () {
15-
var rs = rows.map(function (r) {
16-
if (r && typeof r === 'object') {
17-
return { id : r.id, ok : r.ok, name : trim(r.name) };
18-
}
19-
else return r;
20-
});
10+
var tc = function (rows) {
11+
12+
var rs = rows.toString('utf8').split('\n');
2113
tt.same(rs, [
2214
'TAP version 13',
23-
'array',
24-
{ id: 1, ok: true, name: 'should be equivalent' },
25-
{ id: 2, ok: true, name: 'should be equivalent' },
26-
{ id: 3, ok: true, name: 'should be equivalent' },
27-
{ id: 4, ok: true, name: 'should be equivalent' },
28-
{ id: 5, ok: false, name: 'plan != count' },
29-
{ id: 6, ok: true, name: 'should be equivalent' },
30-
'tests 6',
31-
'pass 5',
32-
'fail 1'
15+
'# array',
16+
'ok 1 should be equivalent',
17+
'ok 2 should be equivalent',
18+
'ok 3 should be equivalent',
19+
'ok 4 should be equivalent',
20+
'not ok 5 plan != count',
21+
' ---',
22+
' operator: fail',
23+
' expected: 3',
24+
' actual: 4',
25+
' ...',
26+
'ok 6 should be equivalent',
27+
'',
28+
'1..6',
29+
'# tests 6',
30+
'# pass 5',
31+
'# fail 1',
32+
''
3333
]);
34-
});
34+
};
3535

36-
test.createStream().pipe(tc);
36+
test.createStream().pipe(concat(tc));
3737

3838
test('array', function (t) {
3939
t.plan(3);

0 commit comments

Comments
 (0)