Use headless chrome instead of phantomjs for tests

pull/21833/head
Richard van der Hoff 2017-07-05 14:39:02 +01:00
parent 167ce88a80
commit f69033c907
3 changed files with 26 additions and 5 deletions

View File

@ -1,6 +1,15 @@
# we need trusty for the chrome addon
dist: trusty
# we don't need sudo, so can run in a container, which makes startup much
# quicker.
sudo: false
language: node_js
node_js:
- node # Latest stable version of nodejs.
addons:
chrome: stable
install:
- npm install
- (cd node_modules/matrix-js-sdk && npm install)

View File

@ -116,11 +116,25 @@ module.exports = function (config) {
browsers: [
'Chrome',
//'PhantomJS',
//'ChromeHeadless',
],
customLaunchers: {
'ChromeHeadless': {
base: 'Chrome',
flags: [
// 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: true,
// singleRun: false,
// Concurrency level
// how many browser should be started simultaneous

View File

@ -41,8 +41,8 @@
"lintall": "eslint src/ test/",
"clean": "rimraf lib",
"prepublish": "npm run build && git rev-parse HEAD > git-revision.txt",
"test": "karma start $KARMAFLAGS --browsers PhantomJS",
"test-multi": "karma start $KARMAFLAGS --single-run=false"
"test": "karma start $KARMAFLAGS --single-run=true --browsers ChromeHeadless",
"test-multi": "karma start $KARMAFLAGS"
},
"dependencies": {
"babel-runtime": "^6.11.6",
@ -106,12 +106,10 @@
"karma-cli": "^0.1.2",
"karma-junit-reporter": "^0.4.1",
"karma-mocha": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"mocha": "^2.4.5",
"parallelshell": "^1.2.0",
"phantomjs-prebuilt": "^2.1.7",
"react-addons-test-utils": "^15.4.0",
"require-json": "0.0.1",
"rimraf": "^2.4.3",