Skip to content

Commit 32de411

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 1b8cc13 commit 32de411

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
@@ -33,8 +33,11 @@
3333
* preprocessor, which is needed to be able to debug tests properly in a browser.
3434
*/
3535

36+
const { existsSync } = require('node:fs');
37+
3638
if (!process.env.CHROMIUM_BIN) {
37-
process.env.CHROMIUM_BIN = require('puppeteer').executablePath()
39+
const chrome = require('puppeteer').executablePath()
40+
process.env.CHROMIUM_BIN = chrome
3841
}
3942

4043
const webpack = require('webpack');
@@ -273,14 +276,19 @@ module.exports = function(config) {
273276
// - PhantomJS
274277
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
275278
// use PhantomJS_debug for extra local debug
276-
browsers: ['ChromiumHeadless'],
279+
browsers: ['Chrome_without_sandbox'],
277280

278281
// you can define custom flags
279282
customLaunchers: {
280283
PhantomJS_debug: {
281284
base: 'PhantomJS',
282285
debug: true
283-
}
286+
},
287+
// fix CI
288+
Chrome_without_sandbox: {
289+
base: 'ChromiumHeadless',
290+
flags: ['--no-sandbox'],
291+
},
284292
},
285293

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

0 commit comments

Comments
 (0)