Skip to content

Commit 1343f8f

Browse files
committed
test: fix CI when running Karma tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent fc27c4c commit 1343f8f

File tree

3 files changed

+65
-77
lines changed

3 files changed

+65
-77
lines changed

package-lock.json

Lines changed: 53 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"karma-spec-reporter": "^0.0.36",
172172
"karma-viewport": "^1.0.9",
173173
"mime": "^4.0.6",
174-
"puppeteer": "^24.1.1",
174+
"puppeteer": "^24.4.0",
175175
"raw-loader": "^4.0.2",
176176
"regextras": "^0.8.0",
177177
"sass": "^1.81.0",

tests/karma.config.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
* preprocessor, which is needed to be able to debug tests properly in a browser.
1919
*/
2020

21+
const { existsSync } = require('node:fs');
22+
2123
if (!process.env.CHROMIUM_BIN) {
22-
process.env.CHROMIUM_BIN = require('puppeteer').executablePath()
24+
const chrome = require('puppeteer').executablePath()
25+
process.env.CHROMIUM_BIN = chrome
2326
}
2427

2528
/* jshint node: true */
@@ -243,14 +246,19 @@ module.exports = function(config) {
243246
// - PhantomJS
244247
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
245248
// use PhantomJS_debug for extra local debug
246-
browsers: ['ChromiumHeadless'],
249+
browsers: ['Chrome_without_sandbox'],
247250

248251
// you can define custom flags
249252
customLaunchers: {
250253
PhantomJS_debug: {
251254
base: 'PhantomJS',
252255
debug: true
253-
}
256+
},
257+
// fix CI
258+
Chrome_without_sandbox: {
259+
base: 'ChromiumHeadless',
260+
flags: ['--no-sandbox'],
261+
},
254262
},
255263

256264
// If browser does not capture in given timeout [ms], kill it

0 commit comments

Comments
 (0)