Created
March 2, 2015 19:54
-
-
Save crowelch/9b12367d816f055ef949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| }); | |
| }); | |
| }); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Raw transform stream test, look ok?