summaryrefslogtreecommitdiff
path: root/config/karma.config.js
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-02 15:12:04 -0500
committerMike Greiling <mike@pixelcog.com>2018-10-02 15:15:43 -0500
commita9df7d866dc726ded2cb0a295a4af68a010201e2 (patch)
tree802c8496dcdf4621a920db7a2d14cbbfedf128ef /config/karma.config.js
parent1efed5d3892618f0161506d1bade19738c418c64 (diff)
downloadgitlab-ce-a9df7d866dc726ded2cb0a295a4af68a010201e2.tar.gz
Remove babel-plugin-transform-define dependency
Diffstat (limited to 'config/karma.config.js')
-rw-r--r--config/karma.config.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/config/karma.config.js b/config/karma.config.js
index cad3c0e9193..7960bbf69ad 100644
--- a/config/karma.config.js
+++ b/config/karma.config.js
@@ -6,7 +6,6 @@ const argumentsParser = require('commander');
const webpackConfig = require('./webpack.config.js');
const ROOT_PATH = path.resolve(__dirname, '..');
-const GENERATE_COVERAGE_REPORT = process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage';
function fatalError(message) {
console.error(chalk.red(`\nError: ${message}\n`));
@@ -24,7 +23,11 @@ webpackConfig.optimization.splitChunks = false;
webpackConfig.devtool = 'cheap-inline-source-map';
webpackConfig.plugins.push(
- new webpack.DefinePlugin({ GENERATE_COVERAGE_REPORT }),
+ new webpack.DefinePlugin({
+ 'process.env': {
+ BABEL_ENV: JSON.stringify(process.env.BABEL_ENV || process.env.NODE_ENV || null),
+ },
+ })
);
const specFilters = argumentsParser
@@ -89,7 +92,7 @@ module.exports = function(config) {
basePath: ROOT_PATH,
browsers: ['ChromeHeadlessCustom'],
client: {
- color: !process.env.CI
+ color: !process.env.CI,
},
customLaunchers: {
ChromeHeadlessCustom: {
@@ -123,7 +126,7 @@ module.exports = function(config) {
};
}
- if (GENERATE_COVERAGE_REPORT) {
+ if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') {
karmaConfig.reporters.push('coverage-istanbul');
karmaConfig.coverageIstanbulReporter = {
reports: ['html', 'text-summary'],