forked from vespertilian/inactivity-countdown-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
128 lines (117 loc) · 3.73 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
var webpackConfig = require('./webpack.config');
var fs = require('fs');
module.exports = function(config) {
var saucelabs = process.env.SAUCELABS === 'true';
if (saucelabs && !process.env.SAUCE_USERNAME) {
if (!fs.existsSync('sauce.json')) {
console.log('Create a sauce.json with your credentials based on the sauce-sample.json file.');
process.exit(1);
} else {
process.env.SAUCE_USERNAME = require('./sauce').username;
process.env.SAUCE_ACCESS_KEY = require('./sauce').accessKey;
}
}
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 7',
version: '51'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '45'
},
w7_ie8: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},
w7_ie9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
w7_ie10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '10'
},
w7_ie11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '11'
},
w10_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13'
},
osX_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '9.0'
}
};
var settings = {
basePath: '',
frameworks: ['jasmine'],
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
autoWatchBatchDelay: 300,
files: ['./tests/**/*.ts'],
preprocessors: {
'./tests/**/*.spec.ts': ['webpack']
},
webpack: {
mode: 'development',
module: webpackConfig.module,
resolve: webpackConfig.resolve,
devtool: 'inline-source-map'
},
webpackMiddleware: {
noInfo: true
},
sauceLabs: {
testName: 'inactivtyLog',
connectOptions: {
dns: '8.8.8.8'
}
},
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: true, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: false, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: false // print the time elapsed for each spec
},
mime: {
'text/x-typescript': ['ts','tsx']
}
};
if(saucelabs){
settings.reporters = ['dots', 'saucelabs'];
settings.captureTimeout = 120000;
settings.customLaunchers = customLaunchers;
settings.browsers = Object.keys(customLaunchers);
settings.singleRun = true;
settings.concurrency = 3;
} else {
settings.reporters = ['spec']; // Add spec reporter for local testing
settings.browsers = ['Chrome'];
settings.singleRun = false;
settings.concurrency = Infinity;
}
config.set(settings);
};