Skip to content

Commit

Permalink
chore: add karma single run env
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuwoo.choi authored and seonim-ryu committed Jan 6, 2020
1 parent b82e0c9 commit 6fefc59
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/editor/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const localhostWebDriver = {
remoteHost: true
};
const configurator = {};
// {('nhnent'|'saucelabs'|'localhost'|'noserver')}
// 'nhnent'|'saucelabs'|'localhost'|'noserver'
const SERVER = process.env.SERVER || 'noserver';
// {('Chrome'|'Safari'|'IE10'|'IE11'|'Edge'|'Firefox'|undefined)}
// 'Chrome'|'Safari'|'IE10'|'IE11'|'Edge'|'Firefox'
const BROWSER = process.env.BROWSER;
// 'true'|'false'
const SINGLE_RUN = process.env.SINGLE_RUN === 'true';

/**
* make customLauncher format object
Expand Down Expand Up @@ -129,14 +131,14 @@ configurator.localhost = function(defaultConfig) {
defaultConfig.browsers = [
BROWSER || 'Chrome'
];
defaultConfig.singleRun = false;
defaultConfig.singleRun = SINGLE_RUN || false;
};

configurator.noserver = function(defaultConfig) {
defaultConfig.browsers = [
BROWSER || 'Chrome'
];
defaultConfig.singleRun = false;
defaultConfig.singleRun = SINGLE_RUN || false;
};

module.exports = function(config) {
Expand Down Expand Up @@ -248,7 +250,7 @@ module.exports = function(config) {

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
singleRun: SINGLE_RUN || true
};

configurator[SERVER](defaultConfig);
Expand Down

0 comments on commit 6fefc59

Please sign in to comment.