Skip to content

Commit

Permalink
[test] Reduce compile time of test:karma in watchmode drastically
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Feb 16, 2021
1 parent 2fe9dbb commit f57f0bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/karma.conf.js
@@ -1,6 +1,8 @@
const playwright = require('playwright');
const webpack = require('webpack');

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

let build = `material-ui 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.NODE_ENV': JSON.stringify('test'),
Expand Down Expand Up @@ -97,15 +99,15 @@ module.exports = function setKarmaConfig(config) {
},
webpackMiddleware: {
noInfo: true,
writeToDisk: Boolean(process.env.CI),
writeToDisk: CI,
},
customLaunchers: {
chromeHeadless: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
singleRun: Boolean(process.env.CI),
singleRun: CI,
};

let newConfig = baseConfig;
Expand Down

0 comments on commit f57f0bf

Please sign in to comment.