@@ -191,7 +191,9 @@ require( [ 'tests' ], bender.defer(), function( err ) {
*/
appendBenderLauncher() {
return through( { objectMode: true }, ( file, encoding, callback ) => {
- file.contents = new Buffer( file.contents.toString() + utils.benderLauncherCode );
+ if ( !file.isNull() ) {
+ file.contents = new Buffer( file.contents.toString() + utils.benderLauncherCode );
+ }
callback( null, file );
} );
@@ -442,6 +442,26 @@ describe( 'build-utils', () => {
stream.end();
+
+ // #62
+ it( 'does nothing to a null file', ( done ) => {
+ const stream = utils.appendBenderLauncher();
+ stream.pipe(
+ utils.noop( ( data ) => {
+ expect( data.contents ).to.equal( null );
+ done();
+ } )
+ );
+ stream.write( new Vinyl( {
+ cwd: './',
+ path: 'tests/file.js',
+ contents: null
+ } ) );
+ stream.end();
+ } );
describe( 'isTestFile', () => {