Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Reduce compile time of test:karma in watchmode drastically #24967

Merged
merged 1 commit into from Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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