-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkarma.conf.js
115 lines (109 loc) · 3.55 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
/*
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
*/
const path = require('path');
const { updateWebpackConfigForLocales } = require('./utils/buildWebpackConfig');
module.exports = function (config) {
const saucelabsLaunchers = {
sl_ie: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 10',
version: 'latest'
},
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest'
},
sl_android_simulator: {
base: 'SauceLabs',
browserName: 'Chrome',
deviceName: 'Android Emulator',
platformName: 'Android',
platformVersion: 'latest'
},
sl_ios_simulator: {
base: 'SauceLabs',
browserName: 'Safari',
deviceName: 'iPhone Simulator',
platformName: 'iOS',
platformVersion: 'latest'
},
// these don't work yet :(
sl_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: 'latest'
},
sl_ios: {
base: 'SauceLabs',
browserName: 'safari',
device: 'iPhone 6 Device',
platform: 'iOS',
version: 'latest'
},
};
// eslint-disable-next-line global-require
let webpackConfig = require('./webpack.config.js')();
// for the karma test runs, we don't want to have any externals,
// especially js-joda and others should be included!
webpackConfig.externals = undefined;
// clear entry, for karma we use the karmaWebpackTestEntry
webpackConfig.entry = undefined;
// add cldr-data load workaround
webpackConfig.resolve = {
alias: {
'cldr-data$': path.resolve(__dirname, 'test/utils/karma_cldrData.js'),
}
};
const locales = ['en', 'en-GB', 'en-CA', 'de', 'fr']; // these are required for tests
webpackConfig = updateWebpackConfigForLocales(webpackConfig, locales, `${__dirname}/node_modules`);
config.set({
files: [
{ pattern: 'test/karmaWebpackTestEntry.js' },
],
frameworks: [
'mocha',
'chai',
],
preprocessors: {
'test/karmaWebpackTestEntry.js': ['webpack'],
},
webpack: webpackConfig,
webpackMiddleware: {
quiet: true,
noInfo: true,
},
sauceLabs: {
testName: 'js-joda-locale karma Tests',
recordVideo: false,
recordScreenshots: false,
connectOptions: {
logfile: 'sauce_connect.log',
},
},
customLaunchers: Object.assign({}, saucelabsLaunchers, {
'PhantomJS_custom': {
base: 'PhantomJS',
debug: true,
},
}),
browserDisconnectTimeout: 10000, // default 2000
// browserDisconnectTolerance: 1, // default 0
browserNoActivityTimeout: 4 * 60 * 1000, // default 10000
captureTimeout: 4 * 60 * 1000, // default 60000
reporters: ['progress'],
browsers: ['Chrome', 'Firefox', 'PhantomJS'],
plugins: ['karma-*'],
});
};