From d529151cf4abd18918a70e2067e102753cdceafc Mon Sep 17 00:00:00 2001 From: AllanFly120 Date: Wed, 15 Jan 2020 00:21:30 +0000 Subject: [PATCH] fix: use chromeheadless not sandbox reference: https://github.com/karma-runner/karma-chrome-launcher/issues/158 --- package.json | 6 ++---- packages/hash-blob-browser/karma.conf.js | 10 +++++++--- packages/stream-collector-browser/karma.conf.js | 8 +++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index d1764ba21d8f..f5e9e65c0ec6 100644 --- a/package.json +++ b/package.json @@ -56,10 +56,8 @@ "clients/*" ], "nohoist": [ - "**/karma", - "**/karma/**", - "**/karma-*", - "**/karma-*/**" + "**/karma*", + "**/karma*/**" ] }, "husky": { diff --git a/packages/hash-blob-browser/karma.conf.js b/packages/hash-blob-browser/karma.conf.js index 1c21217261ba..adacd60a122c 100644 --- a/packages/hash-blob-browser/karma.conf.js +++ b/packages/hash-blob-browser/karma.conf.js @@ -48,9 +48,13 @@ module.exports = function(config) { // enable / disable watching file and executing tests whenever any file changes autoWatch: false, - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ["ChromeHeadless"], + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox"] + } + }, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits diff --git a/packages/stream-collector-browser/karma.conf.js b/packages/stream-collector-browser/karma.conf.js index 9f34498cd6ae..beda0d109706 100644 --- a/packages/stream-collector-browser/karma.conf.js +++ b/packages/stream-collector-browser/karma.conf.js @@ -8,7 +8,13 @@ module.exports = function(config) { "**/*.ts": "karma-typescript" }, reporters: ["progress", "karma-typescript"], - browsers: ["ChromeHeadless"], + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox"] + } + }, karmaTypescriptConfig: { tsconfig: "./tsconfig.json", bundlerOptions: {