Commit 1efed5d3 authored by Mike Greiling's avatar Mike Greiling

Merge remote-tracking branch 'origin/psimyn-speedup-karma' into 43511-upgrade-to-babel-7

* origin/psimyn-speedup-karma:
  Fix lint and comments
  Speed up karma runs for development
parents 63bc9a60 47a87fbc
...@@ -6,6 +6,7 @@ const argumentsParser = require('commander'); ...@@ -6,6 +6,7 @@ const argumentsParser = require('commander');
const webpackConfig = require('./webpack.config.js'); const webpackConfig = require('./webpack.config.js');
const ROOT_PATH = path.resolve(__dirname, '..'); const ROOT_PATH = path.resolve(__dirname, '..');
const GENERATE_COVERAGE_REPORT = process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage';
function fatalError(message) { function fatalError(message) {
console.error(chalk.red(`\nError: ${message}\n`)); console.error(chalk.red(`\nError: ${message}\n`));
...@@ -22,6 +23,10 @@ webpackConfig.optimization.splitChunks = false; ...@@ -22,6 +23,10 @@ webpackConfig.optimization.splitChunks = false;
// use quicker sourcemap option // use quicker sourcemap option
webpackConfig.devtool = 'cheap-inline-source-map'; webpackConfig.devtool = 'cheap-inline-source-map';
webpackConfig.plugins.push(
new webpack.DefinePlugin({ GENERATE_COVERAGE_REPORT }),
);
const specFilters = argumentsParser const specFilters = argumentsParser
.option( .option(
'-f, --filter-spec [filter]', '-f, --filter-spec [filter]',
...@@ -118,7 +123,7 @@ module.exports = function(config) { ...@@ -118,7 +123,7 @@ module.exports = function(config) {
}; };
} }
if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { if (GENERATE_COVERAGE_REPORT) {
karmaConfig.reporters.push('coverage-istanbul'); karmaConfig.reporters.push('coverage-istanbul');
karmaConfig.coverageIstanbulReporter = { karmaConfig.coverageIstanbulReporter = {
reports: ['html', 'text-summary'], reports: ['html', 'text-summary'],
......
...@@ -155,7 +155,7 @@ describe('test errors', () => { ...@@ -155,7 +155,7 @@ describe('test errors', () => {
// if we're generating coverage reports, make sure to include all files so // if we're generating coverage reports, make sure to include all files so
// that we can catch files with 0% coverage // that we can catch files with 0% coverage
// see: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15 // see: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15
if (process.env.BABEL_ENV === 'coverage') { if (GENERATE_COVERAGE_REPORT) { // eslint-disable-line no-undef
// exempt these files from the coverage report // exempt these files from the coverage report
const troubleMakers = [ const troubleMakers = [
'./blob_edit/blob_bundle.js', './blob_edit/blob_bundle.js',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment