2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 18:48:55 +00:00
nativefier/gulp/tests/mocha.js
Jia Hao Goh 8f78dd03af Update eslint and use Airbnb style
- Add `npm run lint:fix` command
- Cleanup inferIcon.js logic slightly
2017-04-29 22:52:12 +08:00

28 lines
858 B
JavaScript

import gulp from 'gulp';
import istanbul from 'gulp-istanbul';
import { Instrumenter } from 'isparta';
import mocha from 'gulp-mocha';
import PATHS from './../helpers/src-paths';
gulp.task('mocha', (done) => {
gulp.src([PATHS.CLI_SRC_JS, '!src/cli.js'])
.pipe(istanbul({
instrumenter: Instrumenter,
includeUntested: true,
}))
.pipe(istanbul.hookRequire()) // Force `require` to return covered files
.on('finish', () => gulp.src(PATHS.TEST_SRC, { read: false })
.pipe(mocha({
compilers: 'js:babel-core/register',
recursive: true,
}))
.pipe(istanbul.writeReports({
dir: './coverage',
reporters: ['lcov'],
reportOpts: { dir: './coverage' },
}))
.on('end', done));
});
gulp.task('tdd', ['mocha'], () => gulp.watch(['src/**/*.js', 'test/**/*.js'], ['mocha']));