From 3e3a045a62d2324a810e6e9d711e2346f564188c Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Mon, 4 May 2015 09:06:25 +0100 Subject: [PATCH] added chrome tests --- .travis.yml | 3 +++ karma.conf.js | 22 ++++++++++++++++++---- package.json | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a42a1e4..1b36f00d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ script: npm test node_js: - '0.12' before_install: +- export CHROME_BIN=chromium-browser +- export DISPLAY=:99.0 +- sh -e /etc/init.d/xvfb start - npm install -g bower - bower install before_deploy: diff --git a/karma.conf.js b/karma.conf.js index a018c736..36c41db0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = function(karma) { - karma.set({ + var configuration = { frameworks: [ 'mocha', 'chai', 'browserify'], files: [ @@ -15,6 +15,20 @@ module.exports = function(karma) { transform: ['debowerify'], debug: true }, - browsers: ['PhantomJS'], - }); -}; \ No newline at end of file + browsers: ['PhantomJS', 'Chrome'], + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + } + }; + + if(process.env.TRAVIS){ + configuration.browsers = ['PhantomJS', 'Chrome_travis_ci']; + } + + karma.set(configuration); + +}; + diff --git a/package.json b/package.json index 544c8d63..be015802 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "karma": "^0.12.31", "karma-browserify": "^4.1.2", "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^0.1.8", "karma-mocha": "^0.1.10", "karma-phantomjs-launcher": "^0.1.4", "mocha": "^2.2.4",