Skip to content

Commit

Permalink
[test] Speed-up rebuild in karma (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 17, 2021
1 parent ea1954b commit e2eeef9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const path = require('path');
const webpack = require('webpack');

const CI = Boolean(process.env.CI);

let build = `material-ui-x local ${new Date().toISOString()}`;

if (process.env.CIRCLE_BUILD_URL) {
Expand Down Expand Up @@ -66,7 +68,7 @@ module.exports = function setKarmaConfig(config) {
reporters: ['dots'],
webpack: {
mode: 'development',
devtool: 'inline-source-map',
devtool: CI ? 'inline-source-map' : 'eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
Expand Down Expand Up @@ -110,15 +112,15 @@ module.exports = function setKarmaConfig(config) {
},
webpackMiddleware: {
noInfo: true,
writeToDisk: Boolean(process.env.CI),
writeToDisk: CI,
},
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
singleRun: Boolean(process.env.CI),
singleRun: CI,
};

let newConfig = baseConfig;
Expand Down

0 comments on commit e2eeef9

Please sign in to comment.