Skip to content

Commit 9ca6c14

Browse files
committed
use headless chrome
1 parent 670fa6b commit 9ca6c14

File tree

4 files changed

+78
-329
lines changed

4 files changed

+78
-329
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
dist: trusty
2+
addons:
3+
chrome: stable
14
language: node_js
25
node_js:
36
- stable
@@ -14,7 +17,7 @@ before_install:
1417
before_script:
1518
- greenkeeper-lockfile-update
1619
script:
17-
- yarn test
20+
- node_modules/karma/bin/karma start karma.conf.js --single-run
1821
after_script:
1922
- greenkeeper-lockfile-upload
2023
after_success:

karma.conf.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
const puppeteer = require("puppeteer");
2+
13
process.env.TEST = true;
24
process.env.NODE_ENV = "test";
5+
process.env.CHROME_BIN = puppeteer.executablePath();
36

47
const webpackConfig = require("./webpack.config.js")({ production: false, karma: true });
58

@@ -66,11 +69,11 @@ module.exports = config => {
6669
};
6770

6871
if (process.env.TRAVIS) {
69-
configuration.browsers.push("PhantomJS");
70-
configuration.plugins.push("karma-phantomjs-launcher");
72+
configuration.browsers.push("ChromeHeadless");
73+
configuration.plugins.push("karma-chrome-launcher");
7174
} else {
72-
configuration.browsers.push("PhantomJS");
73-
configuration.plugins.push("karma-phantomjs-launcher");
75+
configuration.browsers.push("ChromeHeadless");
76+
configuration.plugins.push("karma-chrome-launcher");
7477
}
7578

7679
config.set(configuration);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"karma-es6-shim": "^1.0.0",
8181
"karma-mocha": "^1.3.0",
8282
"karma-mocha-reporter": "^2.2.5",
83-
"karma-phantomjs-launcher": "^1.0.4",
8483
"karma-remap-istanbul": "^0.6.0",
8584
"karma-sinon": "^1.0.5",
8685
"karma-sinon-chai": "^2.0.2",
@@ -91,6 +90,7 @@
9190
"open-browser-webpack-plugin": "^0.0.5",
9291
"prettier": "^1.15.2",
9392
"publish-please": "^5.3.0",
93+
"puppeteer": "^1.10.0",
9494
"reflect-metadata": "^0.1.12",
9595
"remap-istanbul": "^0.12.0",
9696
"rimraf": "^2.6.2",

0 commit comments

Comments
 (0)