Skip to content

Commit

Permalink
update test/too_many.js to use concat-stream instead of tap.createCon…
Browse files Browse the repository at this point in the history
…sumer (no longer available in latest tap) tape-testing#312
  • Loading branch information
nelsonic committed Aug 28, 2016
1 parent 453bd55 commit 771e411
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/too_many.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
var falafel = require('falafel');
var tape = require('../');
var tap = require('tap');
var trim = require('string.prototype.trim');
var concat = require('concat-stream');

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

var test = tape.createHarness({ exit : false });
var tc = tap.createConsumer();

var rows = [];
tc.on('data', function (r) { rows.push(r) });
tc.on('end', function () {
var rs = rows.map(function (r) {
if (r && typeof r === 'object') {
return { id : r.id, ok : r.ok, name : trim(r.name) };
}
else return r;
});
var tc = function (rows) {

var rs = rows.toString('utf8').split('\n');
tt.same(rs, [
'TAP version 13',
'array',
{ id: 1, ok: true, name: 'should be equivalent' },
{ id: 2, ok: true, name: 'should be equivalent' },
{ id: 3, ok: true, name: 'should be equivalent' },
{ id: 4, ok: true, name: 'should be equivalent' },
{ id: 5, ok: false, name: 'plan != count' },
{ id: 6, ok: true, name: 'should be equivalent' },
'tests 6',
'pass 5',
'fail 1'
'# array',
'ok 1 should be equivalent',
'ok 2 should be equivalent',
'ok 3 should be equivalent',
'ok 4 should be equivalent',
'not ok 5 plan != count',
' ---',
' operator: fail',
' expected: 3',
' actual: 4',
' ...',
'ok 6 should be equivalent',
'',
'1..6',
'# tests 6',
'# pass 5',
'# fail 1',
''
]);
});
};

test.createStream().pipe(tc);
test.createStream().pipe(concat(tc));

test('array', function (t) {
t.plan(3);
Expand Down

0 comments on commit 771e411

Please sign in to comment.