This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
forked from valor-software/ngx-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
154 lines (146 loc) · 4.19 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
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;
module.exports = function (config) {
const configuration = {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
require('karma-sauce-launcher')
],
files: [
{pattern: './scripts/test.ts', watched: false}
],
preprocessors: {
'./scripts/test.ts': ['@angular/cli']
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['dots', 'coverage-istanbul']
: ['dots', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
customLaunchers: {
Chrome_travis_ci: {
base: 'ChromeHeadless',
flags: ['--disable-translate', '--disable-extensions']
}
},
mime: {'text/x-typescript': ['ts', 'tsx']},
client: {captureConsole: true, clearContext: false}
};
if (process.env.TRAVIS) {
configuration.browsers = ['ChromeHeadless'];
}
if (process.env.SAUCE) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
process.exit(1);
}
configuration.plugins.push(require('karma-sauce-launcher'));
Object.assign(configuration, {
logLevel: config.LOG_INFO,
reporters: ['dots', 'saucelabs'],
singleRun: false,
concurrency: 2,
captureTimeout: 60000,
browserNoActivityTimeout: 20000,
browserDisconnectTimeout: 5000,
sauceLabs: {
testName: 'ngx-bootstrap',
build: process.env.TRAVIS_JOB_NUMBER,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
retryLimit: 5,
startConnect: false,
recordVideo: false,
recordScreenshots: false,
options: {
'command-timeout': 600,
'idle-timeout': 600,
'max-duration': 5400
}
},
customLaunchers: {
'SL_CHROME': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest'
},
'SL_CHROME_1': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest-1'
},
'SL_FIREFOX': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest'
},
'SL_FIREFOX_1': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest-1'
},
'SL_IE10': {
base: 'SauceLabs',
browserName: 'internet explorer',
// platform: 'Windows 2012',
version: '10'
},
'SL_IE11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11.0'
},
'SL_EDGE13': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13'
},
'SL_EDGE14': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '14'
},
'SL_EDGE15': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '15'
},
'SL_SAFARI9': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '9.0'
},
'SL_SAFARI10': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '10.0'
}
}
});
configuration.browsers = Object.keys(configuration.customLaunchers);
}
config.set(configuration);
};