Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save crowelch/9b12367d816f055ef949 to your computer and use it in GitHub Desktop.

Select an option

Save crowelch/9b12367d816f055ef949 to your computer and use it in GitHub Desktop.
describe('Transform._transform', function () {
describe('data mode', function() {
it('should prove that empty transform does nothing, but works', function(done) {
var transformStream = new Transform ({
transform: function(chunk, encoding, cb) {
this.push(chunk);
cb();
}
});
zstreams.fromString('abcd')
.pipe(transformStream)
.intoString(function(error, str) {
console.log(str);
expect(error).to.not.exist;
expect(str).to.have.length(4);
expect(str).to.be.a('string');
done();
});
});
});
describe('object mode', function() {
it('should prove that empty transform does nothing, but works', function(done) {
var transformStream = new Transform ({
objectMode: true,
transform: function(chunk, encoding, cb) {
this.push(chunk);
cb();
}
});
zstreams.fromString('abcd')
.pipe(transformStream)
.intoString(function(error, str) {
expect(error).to.not.exist;
expect(str).to.have.length(4);
expect(str).to.be.a('string');
done();
});
});
});
});
@crowelch
Copy link
Author

crowelch commented Mar 2, 2015

Raw transform stream test, look ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment