Skip to content

Commit

Permalink
Initial progress towards Sauce Labs integration
Browse files Browse the repository at this point in the history
  • Loading branch information
pheuter committed Mar 21, 2015
1 parent e67092c commit 3aa6bee
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ language: node_js
node_js:
- "0.10"
after_script:
- npm run coveralls
- npm run coveralls
- npm run test-cross-browser
env:
global:
- secure: H7Yi0dWwKnnAbGHIQjFnFTDbZy177ghm2VtzV0z9FpAFI5arQZQpE0cIe3glsEawRqXoYSjopLza8oDHRnbYynPj2a7vrQy/duiYFNbTgE4xzXlvZzRMs2D+9De+fMHNjmcsSoEgR9gukwooiN2KYELtQC8tyn/H8T0J3GAGXBM=
- secure: LcwufGqqrC7aMj88Dwkevu2ugmDWIpvL07gLtk3gMu+xPFTnyXtPNgFOXnOOXSl3tsw5w8y04aJvIWNKWN5xHOSBdAd/T4sNfhqhHh5q8h6vwsww4IH9u3cCsEQburY9tnIxs2qUkcIweijsXWXrAZUTP0sckqgq8fTtKW8JF8k=
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[![npm](https://img.shields.io/npm/v/essential-react.svg?style=flat-square)](https://www.npmjs.com/package/essential-react)
[![David](https://img.shields.io/david/pheuter/essential-react.svg?style=flat-square)](https://david-dm.org/pheuter/essential-react)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/essential_react.svg)](https://saucelabs.com/u/essential_react)

A minimal skeleton for building testable React apps using ES6.

- [Design Goals](#design-goals)
Expand Down
108 changes: 108 additions & 0 deletions karma.cross-browser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
module.exports = function(config) {

/**
* Used by sauce labs to launch various browsers
*/
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox'
},
sl_ie: {
base: 'SauceLabs',
browserName: 'internet explorer'
}
}

config.set({
/**
* These are the files required to run the tests.
*
* The `Function.prototype.bind` polyfill is required by PhantomJS
* because it uses an older version of JavaScript.
*/
files: [
'./test/polyfill.js',
'./test/main.js'
],

/**
* The actual tests are preprocessed by the karma-webpack plugin, so that
* their source can be properly transpiled.
*/
preprocessors: {
'./test/main.js': ['webpack']
},

/**
* We want to run the tests using the PhantomJS headless browser.
* This is especially useful for continuous integration.
*/
browsers: Object.keys(customLaunchers),

/**
* Use Mocha as the test framework, Sinon for mocking, and
* Chai for assertions.
*/
frameworks: ['mocha', 'sinon-chai'],

/**
* After running the tests, return the results and generate a
* code coverage report.
*/
reporters: ['dots', 'saucelabs'],


/**
* The configuration for the karma-webpack plugin.
*/
webpack: {
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader"}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
}
},

/**
* Configuration option to turn off verbose logging of webpack compilation.
*/
webpackMiddleware: {
noInfo: true
},

/**
* Once the mocha test suite returns, we want to exit from the test runner as well.
*/
singleRun: true,

/**
* Identifies the sauce labs session name
*/
sauceLabs: {
testName: 'Essential React Unit Tests'
},

/**
* Used by sauce labs to launch the various browsers defined above
*/
customLaunchers: customLaunchers,

/**
* List of plugins
*/
plugins: [
'karma-mocha',
'karma-webpack',
'karma-sinon-chai',
'karma-sauce-launcher'
],
});
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"server": "node server.js",
"build": "webpack -p --config webpack.production.config.js",
"test": "PHANTOMJS_BIN=./node_modules/.bin/phantomjs ./node_modules/karma/bin/karma start karma.config.js",
"test-cross-browser": "./node_modules/karma/bin/karma start karma.cross-browser.config.js",
"coveralls": "cat coverage/lcov.info | coveralls",
"clean": "rm build/app.js"
},
Expand Down Expand Up @@ -37,6 +38,7 @@
"karma-coverage": "^0.2.7",
"karma-mocha": "^0.1.10",
"karma-phantomjs-launcher": "^0.1.4",
"karma-sauce-launcher": "^0.2.10",
"karma-sinon-chai": "^0.3.0",
"karma-webpack": "^1.5.0",
"phantomjs": "^1.9.16",
Expand Down

0 comments on commit 3aa6bee

Please sign in to comment.