From 38b1ca9b901f2a9a1069d40e3d24561570428177 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 5 Jul 2017 09:35:51 +0100 Subject: [PATCH] Use headless chrome instead of phantomjs for tests --- karma.conf.js | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 1e0436631..d834987e8 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -113,8 +113,23 @@ module.exports = function (config) { browsers: [ 'Chrome', //'PhantomJS', + //'ChromeHeadless' ], + customLaunchers: { + 'ChromeHeadless': { + base: 'Chrome', + flags: [ + // '--no-sandbox', + // See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md + '--headless', + '--disable-gpu', + // Without a remote debugging port, Google Chrome exits immediately. + '--remote-debugging-port=9222', + ], + } + }, + // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits // singleRun: false, diff --git a/package.json b/package.json index 3d7e6935f..dc1058c9e 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "lintall": "eslint src/ test/", "clean": "rimraf lib webapp electron_app/dist", "prepublish": "npm run build:compile", - "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", + "test": "karma start --single-run=true --autoWatch=false --browsers ChromeHeadless --colors=false", "test-multi": "karma start" }, "dependencies": {