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] Speed-up rebuild in karma #1064

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename the var to isCI has boolean convention isSomething | hasItem

Copy link
Member Author

@oliviertassinari oliviertassinari Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware we have a convention for naming boolean. I believe, so far, we have used them interchangeably. Often omitting is.

Here I think that we should aim toward importing the config file from the mono repo so we don't have to bring improvements like this manually.


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

if (process.env.CIRCLE_BUILD_URL) {
Expand Down Expand Up @@ -57,7 +59,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 @@ -101,15 +103,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