forked from maykinmedia/dual-listbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
160 lines (136 loc) · 4.07 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
const clone = require('clone');
const paths = require('./build/paths');
const webpackConfig = clone(require('./webpack.config.js'));
// Add istanbul-instrumenter to webpack configuration
webpackConfig.module.rules.push({
test: /\.js$/,
include: __dirname + '/' + paths.jsSrcDir,
loader: 'istanbul-instrumenter-loader',
enforce: 'post',
options: {
esModules: true
}
});
webpackConfig.output.filename += '.test';
webpackConfig.plugins = undefined;
webpackConfig.externals = undefined;
webpackConfig.target = undefined;
// The preprocessor config
const preprocessors = {};
preprocessors[paths.jsSpecEntry] = [
'webpack'
];
function ConfigException(message) {
this.message = message;
this.name = 'ConfigException';
}
// The main configuration
module.exports = function (config) {
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.');
}
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
const customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest'
},
sl_chrome_2: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest-1'
},
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: 'latest'
},
sl_edge_2: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '14.14393'
},
// sl_safari: {
// base: 'SauceLabs',
// browserName: 'safari',
// platform: 'macOS 10.14',
// version: '12.0'
// },
sl_safari_2: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.13',
version: '11.1'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest'
},
sl_firefox_2: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest-1'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
}
config.set({
frameworks: [
'fixture',
'jasmine-ajax',
'jasmine'
],
files: [
'node_modules/@babel/polyfill/dist/polyfill.js',
paths.jsSpecEntry
],
preprocessors: preprocessors,
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
hostname: 'localhost',
sauceLabs: {
testName: 'dual-listbox browser testing',
// startConnect: false,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
},
webpackMiddleware: {
noInfo: true
},
browserNoActivityTimeout: 200000,
captureTimeout: 200000,
colors: true,
concurrency: 5,
customLaunchers: customLaunchers,
retryLimit: 5,
singleRun: false,
browsers: (process.env.TRAVIS) ? Object.keys(customLaunchers) : ['Chrome', 'Firefox'],
reporters: (process.env.TRAVIS) ? ['spec', 'coverage', 'saucelabs', 'coveralls'] : ['spec', 'coverage'],
specReporter: {
suppressSkipped: true,
},
coverageReporter: {
dir: paths.coverageDir,
reporters: [
{type: 'html'},
{type: 'text'},
{type: 'text-summary'},
]
},
});
};