Skip to content

Commit

Permalink
fix chrome headless issue when running as root
Browse files Browse the repository at this point in the history
  • Loading branch information
art-in committed Jun 26, 2019
1 parent c67655b commit f51a5c5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tasks/utils/run-unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const KarmaServer = require('karma').Server;
*/
function runUnitTests(opts) {
return new Promise(function(resolve) {
let chrome = 'ChromeHeadless';
let chrome = 'ChromeHeadlessNoSandbox';

if (require('os').platform() === 'win32') {
// TODO: karma cannot capture headless chrome in windows 7,
Expand Down Expand Up @@ -47,6 +47,14 @@ function runUnitTests(opts) {
stats: 'errors-only'
},

customLaunchers: {
// chrome does not support running as root without --no-sandbox
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},

browsers: [chrome],

frameworks: ['mocha'],
Expand Down

0 comments on commit f51a5c5

Please sign in to comment.