Pipe babel to nodeunit via gulp without writing transpiled files to disk

278 Views Asked by At

I'm trying to run nodeunit tests with support of ES6 features. To make feature support wider I use Babeljs transpiler.

gulp.task('test', function() {
  return gulp.
    src('src/**/*.js').
    pipe(babel()).
    pipe(gulp.dest("/dev/null")). // I'd like to get rid of it
    pipe(nodeunit()).
    on('error', function() {
        this.emit('end');
    });
});

The issue is that I don't wan't to write transpiled files to disk, I just want to pass them to nodeunit task. If I remove pipe(gulp.dest("/dev/null")) it seems that pipe(babel()) does nothing or just outputs somewhere in the void. When gulp.dest is in place everything works fine except that it writes files I don't need. So, is it possible to avoid transpiled files writing? And how?

P. S. I know the following ways, but they don't suit me:

  1. I can use io.js to get wider ES6 support
  2. I can just delete files after tests are run
0

There are 0 best solutions below