From 7e05a061fa123aa5e9763aaf9040879cae5f897e Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 22 Mar 2018 23:06:01 +0100 Subject: [PATCH] fix(ci): be able to specify browsers --- .travis.yml | 2 +- karma.conf.js | 22 +++++++++++++++++++--- package.json | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a99948c..a0202db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,4 @@ addons: firefox: "latest-esr" script: - - TEST_BROWSERS=Firefox,PhantomJS xvfb-run npm run all + - TEST_BROWSERS=ChromeHeadless,Firefox,PhantomJS xvfb-run npm run all diff --git a/karma.conf.js b/karma.conf.js index 503ca65..78b1e28 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,7 +2,7 @@ // any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ] var browsers = (process.env.TEST_BROWSERS || 'PhantomJS') - .replace(/^\s+|\s+$/, '') + .replace(/^\s+|\s+$/g, '') .split(/\s*,\s*/g) .map(function(browser) { if (browser === 'ChromeHeadless') { @@ -17,10 +17,15 @@ var browsers = } }); + module.exports = function(karma) { karma.set({ - frameworks: [ 'browserify', 'mocha', 'chai' ], + frameworks: [ + 'browserify', + 'mocha', + 'chai' + ], files: [ 'test/spec/**/*.js' @@ -32,7 +37,18 @@ module.exports = function(karma) { reporters: [ 'progress' ], - browsers: [ browsers ], + customLaunchers: { + ChromeHeadless_Linux: { + base: 'ChromeHeadless', + flags: [ + '--no-sandbox', + '--disable-setuid-sandbox' + ], + debug: true + } + }, + + browsers: browsers, singleRun: true, autoWatch: false, diff --git a/package.json b/package.json index bf5ef49..9f73b57 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "karma-phantomjs-launcher": "^1.0.4", "mocha": "^1.21.4", "npm-run-all": "^4.1.2", + "puppeteer": "^1.2.0", "rollup": "^0.57.1", "rollup-plugin-uglify": "^3.0.0", "watchify": "^3.11.0"