Skip to content
This repository was archived by the owner on Oct 14, 2022. It is now read-only.

Commit 0e52e11

Browse files
committed
Fix custom hostname (only for Travis)
1 parent 538dd9b commit 0e52e11

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

karma.conf.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ module.exports = function(config) {
175175
// Remove text-summary reporter
176176
testConfig.coverageReporter.reporters = testConfig.coverageReporter.reporters.filter(obj => obj.type !== 'text-summary');
177177

178-
// Use custom hostname to prevent Safari disconnects
179-
// https://support.saucelabs.com/hc/en-us/articles/115010079868-Issues-with-Safari-and-Karma-Test-Runner
180-
testConfig.hostname = 'travis.dev';
181-
182-
// Disable logs to prevent Edge/Safari disconnects
183-
testConfig.logLevel = config.LOG_ERROR;
178+
// Travis-specific settings
179+
if ('TRAVIS' in process.env) {
180+
// Use custom hostname to prevent Safari disconnects
181+
// https://support.saucelabs.com/hc/en-us/articles/115010079868-Issues-with-Safari-and-Karma-Test-Runner
182+
testConfig.hostname = 'travis.dev';
183+
}
184184
}
185185
else {
186186
// eslint-disable-next-line
@@ -189,10 +189,9 @@ module.exports = function(config) {
189189
`KARMA: localhost:${testConfig.port}/debug.html\n`,
190190
'============================================================\n'
191191
].join(''));
192-
193-
// Logging: LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG
194-
testConfig.logLevel = config.LOG_INFO;
195192
}
196193

194+
// Logging: LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG
195+
testConfig.logLevel = config.LOG_WARN;
197196
config.set(testConfig);
198197
};

0 commit comments

Comments
 (0)