const gulp = require("gulp"); const eslint = require("gulp-eslint") const fs = require('fs') const shell = require("gulp-shell") const mocha = require('gulp-mocha'); gulp.task("print", () => { console.log("inside gulp"); }) gulp.task("lint", () => { return gulp.src(['./src/**/*.js']) .pipe(eslint()) // run eslint on files matching src .pipe(eslint.format()) .pipe(eslint.format('html', fs.createWriteStream('./reports/lint/lintReport.html'))) .pipe(eslint.failAfterError()) // }) gulp.task("start", shell.task(["node ./src/app.js"])) gulp.task('test', () => { return gulp.src(['./test/*.js'])// fetching all test case files .pipe(mocha( { reporter: 'mocha-junit-reporter', //npm package to generate report reporterOptions: { mochaFile: './testReport/JUnit/file.xml' } } )) //running mocha .on('error', console.error) }); gulp.task('coverage', shell.task([ 'nyc --reporter=lcov --reporter=text mocha' ]));