Skip to content

Commit

Permalink
remove redundant .map that checks typeof r === 'object' ... rows are …
Browse files Browse the repository at this point in the history
…stdout which is String
  • Loading branch information
nelsonic committed Aug 28, 2016
1 parent 7db3bdc commit 0e04ba7
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@ var tap = require('tap');
var trim = require('string.prototype.trim');
var concat = require('concat-stream');

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

var test = tape.createHarness();

test.createStream().pipe(concat(function (body) {
test.createStream().pipe(concat(function (rows) {

var rs = body.toString('utf8').split('\n').map(function (r) {
if (r && typeof r === 'object') {
return { id : r.id, ok : r.ok, name : trim(r.name) };
}
else return r;
});

assert.same(rs, [
tt.same(rows.toString('utf8').split('\n'), [
'TAP version 13',
'# array',
'ok 1 should be equivalent',
Expand Down

0 comments on commit 0e04ba7

Please sign in to comment.