Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit 7b92d54

Browse files
committed
Run tests in Chrome
1 parent 388340b commit 7b92d54

File tree

4 files changed

+25
-75
lines changed

4 files changed

+25
-75
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
language: node_js
22
node_js:
3-
- '0.12'
3+
- '4.2'
4+
before_install:
5+
- export CHROME_BIN=chromium-browser
6+
- export DISPLAY=:99.0
7+
- sh -e /etc/init.d/xvfb start
48
install:
5-
- npm install
9+
- npm install
610
script:
7-
- npm test
11+
- npm test

karma.conf.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Generated on Sat Mar 28 2015 02:55:40 GMT-0400 (EDT)
33

44
module.exports = function(config) {
5-
config.set({
5+
var c = {
66

77
// base path that will be used to resolve all patterns (eg. files, exclude)
88
basePath: '',
@@ -13,8 +13,6 @@ module.exports = function(config) {
1313

1414
// list of files / patterns to load in the browser
1515
files: [
16-
'spec/helpers.js',
17-
'node_modules/react/dist/react-with-addons.js',
1816
'node_modules/sinon/pkg/sinon.js',
1917
'spec/**/*.spec.+(jsx|js)'
2018
],
@@ -48,7 +46,14 @@ module.exports = function(config) {
4846

4947
// start these browsers
5048
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
51-
browsers: ['PhantomJS'],
49+
browsers: ['Chrome'],
50+
51+
customLaunchers: {
52+
ChromeTravis: {
53+
base: 'Chrome',
54+
flags: ['--no-sandbox']
55+
}
56+
},
5257

5358
// Continuous Integration mode
5459
// if true, Karma captures browsers, runs the tests and exits
@@ -59,8 +64,7 @@ module.exports = function(config) {
5964
'karma-chai',
6065
'karma-webpack',
6166
'karma-spec-reporter',
62-
'karma-chrome-launcher',
63-
'karma-phantomjs-launcher'
67+
'karma-chrome-launcher'
6468
],
6569

6670
webpack: {
@@ -79,5 +83,11 @@ module.exports = function(config) {
7983
noInfo: true
8084
}
8185

82-
});
86+
};
87+
88+
if (process.env.TRAVIS) {
89+
c.browsers = ['ChromeTravis'];
90+
}
91+
92+
config.set(c);
8393
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"chai": "^3.4.1",
3434
"karma": "^0.13.19",
3535
"karma-chai": "^0.1.0",
36+
"karma-chrome-launcher": "^0.2.2",
3637
"karma-mocha": "^0.2.1",
37-
"karma-phantomjs-launcher": "^0.2.3",
3838
"karma-spec-reporter": "0.0.23",
3939
"karma-webpack": "^1.7.0",
4040
"minimist": "^1.2.0",

spec/helpers.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)