Skip to content

Commit

Permalink
Added a check if using CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorik Kraaikamp committed Jul 17, 2017
1 parent 9326749 commit cc75026
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ webpackConfig.plugins = [];
webpackConfig.externals = [];


function ConfigException(message) {
this.message = message;
this.name = 'ConfigException';
}


// The main configuration
module.exports = function(config) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
process.exit(1)
if (process.env.CI && (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY)) {
throw ConfigException('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
}

var customLaunchers = {
Expand Down

0 comments on commit cc75026

Please sign in to comment.