cover everything

This commit is contained in:
Kent C. Dodds 2016-06-27 07:32:09 -06:00
parent 2cf354c65f
commit 6bb1890932

View File

@ -2,20 +2,31 @@ process.env.BABEL_ENV = 'test'
const webpackEnv = {test: true} const webpackEnv = {test: true}
const webpackConfig = require('./webpack.config.babel')(webpackEnv) const webpackConfig = require('./webpack.config.babel')(webpackEnv)
const fileGlob = 'src/**/*.test.js' const testGlob = 'src/**/*.test.js'
const srcGlob = 'src/**/!(*.test|*.stub).js'
module.exports = config => { module.exports = config => {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['mocha', 'chai'], frameworks: ['mocha', 'chai'],
files: [fileGlob], files: [testGlob, srcGlob],
exclude: ['src/bootstrap.js'],
preprocessors: { preprocessors: {
[fileGlob]: ['webpack'] [testGlob]: ['webpack'],
[srcGlob]: ['webpack'],
}, },
webpack: webpackConfig, webpack: webpackConfig,
webpackMiddleware: {noInfo: true}, webpackMiddleware: {noInfo: true},
reporters: ['progress', 'coverage'], reporters: ['progress', 'coverage'],
coverageReporter: { coverageReporter: {
check: {
global: {
statements: 11,
branches: 0,
functions: 0,
lines: 11,
},
},
reporters: [ reporters: [
{type: 'lcov', dir: 'coverage/', subdir: '.'}, {type: 'lcov', dir: 'coverage/', subdir: '.'},
{type: 'json', dir: 'coverage/', subdir: '.'}, {type: 'json', dir: 'coverage/', subdir: '.'},