From 1343f8f442037a4463846fab982c381bbf401cf0 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 16 Mar 2025 12:59:43 +0100 Subject: test: fix CI when running Karma tests Signed-off-by: Ferdinand Thiessen --- tests/karma.config.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/karma.config.js b/tests/karma.config.js index db8e6e9734d..072bb9d766a 100644 --- a/tests/karma.config.js +++ b/tests/karma.config.js @@ -18,8 +18,11 @@ * preprocessor, which is needed to be able to debug tests properly in a browser. */ +const { existsSync } = require('node:fs'); + if (!process.env.CHROMIUM_BIN) { - process.env.CHROMIUM_BIN = require('puppeteer').executablePath() + const chrome = require('puppeteer').executablePath() + process.env.CHROMIUM_BIN = chrome } /* jshint node: true */ @@ -243,14 +246,19 @@ module.exports = function(config) { // - PhantomJS // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) // use PhantomJS_debug for extra local debug - browsers: ['ChromiumHeadless'], + browsers: ['Chrome_without_sandbox'], // you can define custom flags customLaunchers: { PhantomJS_debug: { base: 'PhantomJS', debug: true - } + }, + // fix CI + Chrome_without_sandbox: { + base: 'ChromiumHeadless', + flags: ['--no-sandbox'], + }, }, // If browser does not capture in given timeout [ms], kill it -- cgit v1.2.3