Skip to content

Commit 18a8bf1

Browse files
committed
ci chrome
1 parent 03f4726 commit 18a8bf1

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
udo: required
1+
sudo: required
22
dist: trusty
33
language: node_js
44
cache:
55
directories:
6-
- $HOME/.npm
76
- $HOME/.yarn-cache
8-
- node_modules
97
node_js:
108
- '6.7.0'
119

1210
before_install:
13-
- npm install -g yarn@">=0.16.0" --cache-min 999999999
11+
- export CHROME_BIN=chromium-browser
12+
- export DISPLAY=:99.0
13+
- sh -e /etc/init.d/xvfb start
14+
# Repo for yarn
15+
- sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
16+
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
17+
- sudo apt-get update -qq
18+
- sudo apt-get install -y -qq yarn
1419
install:
1520
- yarn install
1621

17-
script: yarn run sass && node_modules/karma/bin/karma start --browsers PhantomJS
22+
script:
23+
- yarn test
1824

1925
before_deploy:
2026
# Parse branch name and determine an environment to deploy

config/karma.conf.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
module.exports = function (config) {
2-
var testWebpackConfig = require('./webpack.test.js');
3-
config.set({
2+
const testWebpackConfig = require('./webpack.test.js');
3+
const configuration = {
44
basePath: '',
55
frameworks: ['jasmine'],
66
exclude: [],
77
files: [
8-
{pattern: './config/spec-bundle.js', watched: false}
8+
{pattern: './config/spec-bundle.js', watched: false},
99
],
1010
preprocessors: {
11-
'./config/spec-bundle.js': ['webpack', 'sourcemap']
11+
'./config/spec-bundle.js': ['webpack', 'sourcemap'],
1212
},
1313
webpack: testWebpackConfig,
1414
webpackServer: {
15-
noInfo: true
15+
noInfo: true,
1616
},
1717
reporters: ['mocha'],
1818
port: 9876,
1919
colors: true,
2020
logLevel: config.LOG_INFO,
2121
autoWatch: true,
2222
browsers: ['Chrome'],
23-
singleRun: true
24-
});
23+
customLaunchers: {
24+
ChromeTravisCi: {
25+
base: 'Chrome',
26+
flags: ['--no-sandbox'],
27+
},
28+
},
29+
singleRun: true,
30+
};
31+
32+
if (process.env.TRAVIS){
33+
configuration.browsers = [
34+
'ChromeTravisCi'
35+
];
36+
}
37+
38+
config.set(configuration);
2539
};

0 commit comments

Comments
 (0)