Skip to content

Commit 7d6b63c

Browse files
committed
Update Karma's configuration to fix Chrome's startup on CI
Use the same `--no-sandbox` and `--disable-setuid-sandbox` flags as on GOV.UK Frontend to enable Chrome to run on CI.
1 parent 96bf629 commit 7d6b63c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/karma.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ module.exports = function (config) {
1414
frameworks: ['mocha', 'webpack'],
1515
reporters: ['mocha'],
1616

17-
browsers: ['ChromeHeadless'],
17+
// Chrome won't run on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` flags are applied
18+
// Karma's Chrome Headless seems based on Puppeteer and runs into this issue:
19+
// https://github.com/Googlechrome/puppeteer/issues/290
20+
browsers: ['ChromeHeadlessNoSandbox'],
21+
customLaunchers: {
22+
ChromeHeadlessNoSandbox: {
23+
base: 'ChromeHeadless',
24+
flags: ['--no-sandbox', '--disable-setuid-sandbox']
25+
}
26+
},
1827

1928
files: [
2029
'test/functional/**/*.js'

0 commit comments

Comments
 (0)