Skip to content

Commit

Permalink
Simplify karma.conf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 12, 2021
1 parent 0a9d392 commit 00dc3f6
Showing 1 changed file with 6 additions and 10 deletions.
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

0 comments on commit 00dc3f6

Please sign in to comment.