Skip to content

Commit

Permalink
Coverage reporting + restored original browser matrix + other fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Jan 29, 2015
1 parent 7044763 commit b0c6ec5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
global:
- secure: df9eTd6JkMOgdF3J3UInb0ouaDEbF4Y0sklmvwgBUs38yRvGQ3mucrzH13dCU0GYW8mM/H9euF7yG4/leWQHoUYdRJTDRy/sWXGvs6qg7DTkUXsmGyzv/5XxS86WTD5B9LbzB1hvRs5nzWeA1sFP6rpzGG6HwogM/+37ijRjKQQ=
- secure: FI6ATM3Pngx0bowuYi5WHIDCe0R5ORlJWNsFxJyZLEusie+wZrRy9QbZsVvJGVYZJKAR9MFT3Ks494ou85lyfUnfvEnn+lX2DQ3Hsyz0xyBNoSvNkQbhZEsUr0TV+UGpCvSwYr6lYqXsBy6VxqyAkXDkqdVTAzMydq5ttGxszPU=
- secure: "ctyTk+LdMsch1jTRLLTboJW2TsJCIRtXktEQ86JdGteg0YSvsqDj/LndUaaGZ2ZSR3sSJ1Q/YV1X0M0VizrzX5I7/3WnKViyeKygJ5sSbTuqkjwFa2sAAmrnmBv9JWofIc2XuRG3tfZv2fX6QMDy5PA72KGPBmGAw4S8WTxGkHQ="
matrix:
allow_failures:
- env: TARGET=saucelabs
Expand All @@ -18,4 +19,4 @@ before_script:
- make
script:
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
- npm test
- TRAVIS_CI=1 npm test
92 changes: 48 additions & 44 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
module.exports = function(config) {
var saucelabs_browsers = {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
version: '39'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox',
version: '31'
},
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10',
version: '8'
},
'SL_IE_9': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2008',
version: '9'
},
'SL_IE_10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
},
'SL_IE_11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
};
var saucelabsBrowsers = [
// mobile
{platform: 'OS X 10.10', browserName: 'iPhone', version: '8.1'},
{platform: 'OS X 10.10 ', browserName: 'iPhone', version: '6.0'},
{platform: 'OS X 10.10', browserName: 'iPad', version: '8.1'},
{platform: 'OS X 10.10', browserName: 'iPad', version: '6.0'},
{platform: 'Linux', browserName: 'android', version: '4.4'},
{platform: 'Linux', browserName: 'android', version: '4.3'},
// desktop (safari)
{platform: 'OS X 10.8', browserName: 'safari', version: 6},
{platform: 'OS X 10.9', browserName: 'safari', version: 7},
{platform: 'OS X 10.10', browserName: 'safari', version: 8},
// desktop (chrome)
{platform: 'OS X 10.10', browserName: 'chrome', version: 39},
{platform: 'OS X 10.10', browserName: 'chrome', version: 38},
{platform: 'OS X 10.10', browserName: 'chrome', version: 37},
{platform: 'Windows 7', browserName: 'chrome', version: 39},
{platform: 'Windows 7', browserName: 'chrome', version: 38},
{platform: 'Windows 7', browserName: 'chrome', version: 37},
// desktop (firefox)
{platform: 'Windows 7', browserName: 'firefox', version: 35},
{platform: 'Windows 8', browserName: 'firefox', version: 35},
{platform: 'OS X 10.10', browserName: 'firefox', version: 34},
{platform: 'OS X 10.10', browserName: 'firefox', version: 33},
{platform: 'OS X 10.10', browserName: 'firefox', version: 32},
// desktop (internet explorer)
{platform: 'Windows 8', browserName: 'iexplore', version: 10},
{platform: 'Windows 8.1', browserName: 'iexplore', version: 11},
{platform: 'Windows 7', browserName: 'iexplore', version: 9}
];

var customLaunchers = {};
saucelabsBrowsers.forEach(function(browser, i) {
browser.base = 'SauceLabs';
customLaunchers['sl' + i] = browser;
});

var targets = {
'saucelabs': Object.keys(saucelabs_browsers),
'saucelabs': Object.keys(customLaunchers),
'phantomjs': ['PhantomJS']
};

var reporters = ['mocha'];
if (process.env.TRAVIS_CI) {
reporters = process.env.TARGET === 'saucelabs'
? ['progress', 'saucelabs']
: ['mocha', 'coverage', 'coveralls']
}

config.set({
frameworks: ['mocha', 'chai'],
files: [
Expand All @@ -60,21 +67,18 @@ module.exports = function(config) {
'src/**/*.js': ['coverage']
},
coverageReporter: {
type: 'text-summary',
type: process.env.TRAVIS_CI ? 'lcov' : 'text-summary',
dir: 'coverage/'
},
sauceLabs: {
startConnect: true,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
testName: process.env.COMMIT_MESSAGE,
tags: ['selectize', 'test'],
options: {
'selenium-version': '2.41.0'
}
tags: ['selectize', 'test']
},
customLaunchers: saucelabs_browsers,
reporters: ['mocha', 'coverage'],
customLaunchers: customLaunchers,
reporters: reporters,
port: 8888,
colors: true,
captureTimeout: 0,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"karma": "^0.12.31",
"karma-chai": "^0.1.0",
"karma-coverage": "^0.2.7",
"karma-coveralls": "^0.1.5",
"karma-mocha": "^0.1.10",
"karma-mocha-reporter": "^0.3.1",
"karma-phantomjs-launcher": "^0.1.4",
Expand Down

0 comments on commit b0c6ec5

Please sign in to comment.