Skip to content

Commit fcc9435

Browse files
committed
chore (ci): Added before_install and karma.conf settings to run karma/Chrome tests on Travis CI.
1 parent dc8b66d commit fcc9435

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ node_js:
44
cache:
55
directories:
66
- "node_modules"
7+
before_install:
8+
- export CHROME_BIN=chromium-browser
9+
- export DISPLAY=:99.0
10+
- sh -e /etc/init.d/xvfb start

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Date: February 19, 2018
66

7+
- chore (ci): Added integration with Travis CI.
78
- doc: Corrected dependency on angular 1.2.32, added a small section about
89
running test scripts and added new top note to README
910
- chore: corrected module dep to correct package name phantomjs-prebuilt

config/karma.conf.js

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
1-
module.exports = function(config){
2-
config.set({
3-
basePath : '../',
1+
module.exports = function(config) {
2+
config.set({
3+
basePath: '../',
44

5-
files : [
5+
files: [
66
'app/lib/angular-1.2.32/angular.js',
77
'app/lib/angular-1.2.32/angular-*.js',
88
'test/lib/angular-1.2.32/angular-mocks.js',
99
'app/js/**/*.js',
1010
'test/unit/**/*.js'
1111
],
1212

13-
autoWatch : true,
13+
autoWatch: true,
1414

1515
frameworks: ['jasmine'],
1616

17-
browsers : ['Chrome'],
17+
browsers: ['Chrome'],
1818

19-
plugins : [
20-
'karma-junit-reporter',
21-
'karma-chrome-launcher',
22-
'karma-firefox-launcher',
23-
'karma-jasmine'
24-
],
19+
plugins: [
20+
'karma-junit-reporter',
21+
'karma-chrome-launcher',
22+
'karma-firefox-launcher',
23+
'karma-jasmine'
24+
],
2525

26-
junitReporter : {
26+
junitReporter: {
2727
outputFile: 'test_out/unit.xml',
2828
suite: 'unit'
29-
}
29+
},
30+
31+
customLaunchers: {
32+
Chrome_travis_ci: {
33+
base: 'Chrome',
34+
flags: ['--no-sandbox']
35+
}
36+
},
37+
});
3038

31-
})}
39+
if (process.env.TRAVIS) {
40+
config.browsers = ['Chrome_travis_ci'];
41+
}
42+
}

0 commit comments

Comments
 (0)