I have a sample gulp task that uses Mocha json reporter. I would like to write that json output to a file. Would appreciate some inputs.
Here is my code:
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var util = require('gulp-util');
gulp.task('myreport', function() {
return gulp.src(['tests.js'], { read: false })
.pipe(mocha({ reporter: 'json' })) //how do I write this to a file?
.on('error', util.log);
});