Skip to content

Commit

Permalink
fix(ci): karma test should work in travis now
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Nov 11, 2016
1 parent 7548fa6 commit 3d61d48
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ language: node_js
node_js:
- "6"

#before_install: npm i -g npm@latest
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

script:
- npm run build
- npm test

after_success:
Expand Down
18 changes: 15 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
config.set({
const configuration = {
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
Expand Down Expand Up @@ -35,6 +35,18 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
singleRun: false,
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
}
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}

config.set(configuration);
};

0 comments on commit 3d61d48

Please sign in to comment.