From 3e7ec0e7272c3adcab1e5333abb9283fdcced43e Mon Sep 17 00:00:00 2001 From: Jason Salzman Date: Thu, 6 Oct 2016 11:24:23 -0700 Subject: [PATCH] fixing chrome test support in travis --- .travis.yml | 10 +++++++++- karma.conf.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 856aaee..b09c36a 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ -sudo: false +sudo: required +dist: trusty language: node_js node_js: - "6" @@ -19,6 +20,13 @@ before_install: - gem update --system && gem install scss_lint -v 0.44.0 - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start + - export CHROME_BIN=/usr/bin/google-chrome + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - sudo apt-get update + - sudo apt-get install -y libappindicator1 fonts-liberation + - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + - sudo dpkg -i google-chrome*.deb after_success: - bash <(curl -s https://codecov.io/bash) notifications: diff --git a/karma.conf.js b/karma.conf.js index 07327e6..92c70f2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,6 +3,8 @@ var webpack = require('webpack') var path = require('path') +var BROWSERS = (process.env.TRAVIS) ? ['Chrome_travis_ci', 'Firefox'] : ['Chrome', 'Firefox', 'Safari']; + module.exports = function(config) { config.set({ @@ -104,9 +106,17 @@ module.exports = function(config) { autoWatch: false, + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + + // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome', 'Firefox', 'Safari'], + browsers: BROWSERS, // Continuous Integration mode