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

Simplify karma.conf.js #33045

Merged
merged 2 commits into from
Feb 16, 2021
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
16 changes: 6 additions & 10 deletions js/tests/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ const reporters = ['dots']
const detectBrowsers = {
usePhantomJS: false,
postDetection(availableBrowser) {
if (ENV.CI === true || availableBrowser.includes('Chrome')) {
// On CI just use Chrome
if (ENV.CI === true) {
return ['ChromeHeadless']
}

if (availableBrowser.includes('Chrome')) {
return DEBUG ? ['Chrome'] : ['ChromeHeadless']
}

Expand All @@ -49,13 +54,6 @@ const detectBrowsers = {
}
}

const customLaunchers = {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless']
}
}

const conf = {
basePath: '../..',
port: 9876,
Expand Down Expand Up @@ -124,7 +122,6 @@ if (BROWSERSTACK) {
'karma-firefox-launcher',
'karma-detect-browsers'
)
conf.customLaunchers = customLaunchers
conf.detectBrowsers = detectBrowsers
conf.files = [
'node_modules/jquery/dist/jquery.slim.min.js',
Expand All @@ -142,7 +139,6 @@ if (BROWSERSTACK) {
'karma-coverage-istanbul-reporter'
)
reporters.push('coverage-istanbul')
conf.customLaunchers = customLaunchers
conf.detectBrowsers = detectBrowsers
conf.coverageIstanbulReporter = {
dir: path.resolve(__dirname, '../coverage/'),
Expand Down