Skip to content

Commit

Permalink
fix(ci): be able to specify browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Mar 22, 2018
1 parent 6a70bad commit 7e05a06
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 19 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -17,10 +17,15 @@ var browsers =
}
});


module.exports = function(karma) {
karma.set({

frameworks: [ 'browserify', 'mocha', 'chai' ],
frameworks: [
'browserify',
'mocha',
'chai'
],

files: [
'test/spec/**/*.js'
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7e05a06

Please sign in to comment.