Skip to content

Commit

Permalink
fix: add config for optional firefox headless
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenk committed Sep 10, 2024
1 parent f330846 commit 13632ce
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
19 changes: 16 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = function(config) {
'karma-sinon',
'karma-jasmine-html-reporter',
'karma-spec-reporter',
'karma-webpack'
'karma-webpack',
require("karma-firefox-launcher")
],

// frameworks to use
Expand Down Expand Up @@ -107,7 +108,13 @@ module.exports = function(config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['HeadlessChrome'],

browsers: [
'HeadlessChrome'
// 'HeadlessFirefox'
],
// If chrome headless is not working, try swapping out which line is commented above
// to use firefox for local dev
customLaunchers: {
HeadlessChrome: {
base: 'ChromeHeadless',
Expand All @@ -118,7 +125,13 @@ module.exports = function(config) {
'--disable-translate',
'--disable-extensions'
]
}
},
HeadlessFirefox: {
base: 'Firefox',
flags: [
'--headless',
]
},
},

// Continuous Integration mode
Expand Down
30 changes: 28 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "6.11.3",
"version": "6.11.4",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "8.0.6",
Expand Down Expand Up @@ -31,6 +31,7 @@
"karma": "^6.3.9",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^2.1.0",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "4.0.0",
"karma-jasmine-html-reporter": "~0.2",
"karma-jasmine-jquery": "git+https://github.com/nkoder/karma-jasmine-jquery.git#be1566e6a069c867812b3845a46c9c6ca73b1e9f",
Expand Down

0 comments on commit 13632ce

Please sign in to comment.