Gulp streams are not supported. Error using gulp -istanbul

I get an error with streams. I am new to gulp and threads are so bare with me.

I am working on adding istanbul to my existing mocha task. When I run this task, I get the error below.

I am using gulp-istanbul

(note: config.test.src.bdd.features set to 'test/bdd/features/**/*-spec.js' )

 var stream = gulp.src([config.test.src.bdd.features], { read: false }); gulp.task('mocha-bdd-features', function(cb) { process.env.PORT = 8001; return stream .pipe(istanbul()) .pipe(istanbul.hookRequire()) .pipe(mocha({ compilers: { js: babel }, reporter: config.test.mocha.reporter, ui: 'bdd' })) .on('finish', function () { stream.pipe(istanbul.writeReports()) stream.pipe(istanbul.enforceThresholds({thresholds: {global: 90}})) stream.on('end', cb); }); }); 

I get an error:

 events.js:85 throw er; // Unhandled 'error' event ^ Error: streams not supported 

and who knows that I canโ€™t configure this task right away when I try to enable gulp -istanbul, but first Iโ€™ll try to at least skip this error.

+4
source share
1 answer

I ran into the same problem. I believe the problem is in line:

 var stream = gulp.src([config.test.src.bdd.features], { read: false }); 

Setting the read parameter to false causes file.contents to be null, and therefore istanbul cannot cover files. (check here )

try the same thing, but without the reading option.

 var stream = gulp.src([config.test.src.bdd.features]); 

Hope this helps.

0
source

All Articles