From 46fe47cd70ed29ff12b4159287573701bfa3fb03 Mon Sep 17 00:00:00 2001 From: Andreas Alexander Maier Date: Sun, 12 Apr 2020 15:27:28 +0200 Subject: [PATCH] Run karma with firefox In addition, as mentioned in https://github.com/karma-runner/karma-firefox-launcher/issues/106 on WSL there's a hack in the karma firefox launcher index.js file necessary to accomodate a wslpath error. --- karma.conf.js | 4 ++-- package-lock.json | 9 +++++++++ package.json | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 2ba2e0a..9118e5b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -7,7 +7,7 @@ module.exports = function (config) { frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), - require('karma-chrome-launcher'), + require('karma-firefox-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma') @@ -25,7 +25,7 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ['FirefoxHeadless'], singleRun: false, restartOnFileChange: true }); diff --git a/package-lock.json b/package-lock.json index d9aced8..2ac5f43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6645,6 +6645,15 @@ "minimatch": "^3.0.4" } }, + "karma-firefox-launcher": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.3.0.tgz", + "integrity": "sha512-Fi7xPhwrRgr+94BnHX0F5dCl1miIW4RHnzjIGxF8GaIEp7rNqX7LSi7ok63VXs3PS/5MQaQMhGxw+bvD+pibBQ==", + "dev": true, + "requires": { + "is-wsl": "^2.1.0" + } + }, "karma-jasmine": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.0.3.tgz", diff --git a/package.json b/package.json index 54acda3..cffd524 100644 --- a/package.json +++ b/package.json @@ -33,15 +33,16 @@ "@angular/cli": "~9.1.0", "@angular/compiler-cli": "~9.1.0", "@angular/language-service": "~9.1.0", - "@types/node": "^12.11.1", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", + "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.4.1", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~2.1.0", + "karma-firefox-launcher": "^1.3.0", "karma-jasmine": "~3.0.1", "karma-jasmine-html-reporter": "^1.4.2", "protractor": "~5.4.3",