-
Notifications
You must be signed in to change notification settings - Fork 34
/
karma.conf.js
89 lines (87 loc) · 2.1 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
module.exports = config => {
const SAUCE = Boolean(process.env.SAUCE);
const TRAVIS = Boolean(process.env.TRAVIS);
const SAUCE_BROWSERS = {
SL_Chrome: {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest'
},
SL_Firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest'
},
SL_Safari: {
base: 'SauceLabs',
browserName: 'safari',
version: 'latest'
},
SL_Edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
version: 'latest'
},
SL_IE_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11'
}
};
config.set({
frameworks: ['jasmine', 'karma-typescript'],
files: [
'init.spec.ts',
'{forms,polyfills,styles,src,templates,util}/**/*.ts'
],
preprocessors: {
'**/*.ts': 'karma-typescript'
},
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
exclude: ['@polymer/polymer/interfaces'],
transforms: [require('karma-typescript-es6-transform')()]
},
compilerOptions: {
lib: ['dom', 'es6'],
module: 'commonjs',
target: 'es5'
},
coverageOptions: {
exclude: [/\.(d|spec|test)\.ts$/i, /public_api/],
instrumentation: !SAUCE
},
reports: {
html: 'coverage',
'text-summary': ''
},
tsconfig: './tsconfig.json'
},
sauceLabs: {
testName: 'Origami Karma',
startConnect: TRAVIS ? false : true,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
},
client: {
clearContext: false
},
reporters: ['mocha', 'kjhtml', 'karma-typescript'],
reportSlowerThan: 200,
browsers: ['Chrome'],
browserNoActivityTimeout: 60 * 1000,
browserDisconnectTimeout: 10 * 1000,
browserDisconnectTolerance: 1,
captureTimeout: 4 * 60 * 1000,
concurrency: 5,
customLaunchers: {
...SAUCE_BROWSERS
}
});
if (SAUCE) {
config.reporters.push('saucelabs');
config.set({
browsers: Object.keys(SAUCE_BROWSERS)
});
}
};