Skip to content

Commit 38b1ca9

Browse files
committed
Use headless chrome instead of phantomjs for tests
1 parent 48889b5 commit 38b1ca9

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎karma.conf.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,23 @@ module.exports = function (config) {
113113
browsers: [
114114
'Chrome',
115115
//'PhantomJS',
116+
//'ChromeHeadless'
116117
],
117118

119+
customLaunchers: {
120+
'ChromeHeadless': {
121+
base: 'Chrome',
122+
flags: [
123+
// '--no-sandbox',
124+
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
125+
'--headless',
126+
'--disable-gpu',
127+
// Without a remote debugging port, Google Chrome exits immediately.
128+
'--remote-debugging-port=9222',
129+
],
130+
}
131+
},
132+
118133
// Continuous Integration mode
119134
// if true, Karma captures browsers, runs the tests and exits
120135
// singleRun: false,

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"lintall": "eslint src/ test/",
4949
"clean": "rimraf lib webapp electron_app/dist",
5050
"prepublish": "npm run build:compile",
51-
"test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false",
51+
"test": "karma start --single-run=true --autoWatch=false --browsers ChromeHeadless --colors=false",
5252
"test-multi": "karma start"
5353
},
5454
"dependencies": {

0 commit comments

Comments
 (0)