]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Simplify karma.conf.js (#33045)
authorXhmikosR <xhmikosr@gmail.com>
Tue, 16 Feb 2021 10:18:06 +0000 (12:18 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Feb 2021 10:18:06 +0000 (12:18 +0200)
`customLaunchers` does not seem to be needed.

js/tests/karma.conf.js

index cd494652558a0b1d89852d466a3a5c847d521b1b..c13413449d201616726a0dda7a31437fd92447d1 100644 (file)
@@ -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']
     }
 
@@ -49,13 +54,6 @@ const detectBrowsers = {
   }
 }
 
-const customLaunchers = {
-  FirefoxHeadless: {
-    base: 'Firefox',
-    flags: ['-headless']
-  }
-}
-
 const conf = {
   basePath: '../..',
   port: 9876,
@@ -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',
@@ -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/'),