Skip to content

Commit 4158e10

Browse files
susnuxbackportbot[bot]
authored andcommitted
test: fix CI when running Karma tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> [skip ci]
1 parent 143c935 commit 4158e10

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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 */
@@ -249,14 +252,19 @@ module.exports = function(config) {
249252
// - PhantomJS
250253
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
251254
// use PhantomJS_debug for extra local debug
252-
browsers: ['ChromiumHeadless'],
255+
browsers: ['Chrome_without_sandbox'],
253256

254257
// you can define custom flags
255258
customLaunchers: {
256259
PhantomJS_debug: {
257260
base: 'PhantomJS',
258261
debug: true
259-
}
262+
},
263+
// fix CI
264+
Chrome_without_sandbox: {
265+
base: 'ChromiumHeadless',
266+
flags: ['--no-sandbox'],
267+
},
260268
},
261269

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

0 commit comments

Comments
 (0)