Skip to content

Commit

Permalink
try the solution by @MrOrz from karma-runner/karma#1144 to run Chrome…
Browse files Browse the repository at this point in the history
… on Travis
  • Loading branch information
shamansir committed Jun 20, 2015
1 parent 80a6766 commit 46517b6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@ node_js:
- "0.10"
- "iojs"
- "iojs-v1.0.4"
before_script:
- "make test-deps"
script: make test
before_script: make test-deps

# Google Chrome
#
# https://github.com/travis-ci/travis-ci/issues/272#issuecomment-14402117
# http://stackoverflow.com/questions/19255976/how-to-make-travis-execute-angular-tests-on-chrome-please-set-env-variable-chr
#
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
20 changes: 19 additions & 1 deletion spec/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Generated on Sat Jun 20 2015 01:21:00 GMT+0200 (CEST)

module.exports = function(config) {
config.set({
var options = {

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '..',
Expand Down Expand Up @@ -61,9 +61,27 @@ module.exports = function(config) {
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],

customLaunchers: {
'Chrome_travis_ci': {
base: 'Chrome',
flags: ['--no-sandbox']
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});

if (process.env.TRAVIS) {
options.browsers = ['Chrome_travis_ci'];
// configuration.reporters = configuration.reporters.concat(['coverage', 'coveralls']);
// configuration.coverageReporter = {
// type : 'lcovonly',
// dir : 'coverage/'
// };
}

config.set(options);

};

0 comments on commit 46517b6

Please sign in to comment.