GT2/GT2-iOS/node_modules/logfmt/test/through_test.js

24 lines
441 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
var logfmt = require('../logfmt'),
stream = require('stream'),
through = require('through'),
assert = require('assert');
suite('through', function(){
test('through on either side', function(done){
var s = new stream.PassThrough;
s.pipe(through())
.pipe(logfmt.streamParser())
.pipe(through(function(obj){
assert.deepEqual({foo: true}, obj)
done()
}))
s.push('foo\n');
})
})