forked from IgniteUI/ignite-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
218 lines (173 loc) · 9.84 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Karma configuration
// Generated on Fri Dec 08 2017 16:49:49 GMT+0200 (FLE Standard Time)
const filesConfig = require("./build/packages/combined-files");
const glob = require("glob");
// https://github.com/karma-runner/karma-qunit/issues/92
const reporters = ["progress"];
let testPath = "**";
// proxy entries need to be full file paths (no glob support)
let proxies = glob.sync("src/js/**/*.js")
.map((x) => "/base/mock/" + x)
.reduce((obj, val) => {
obj[val] = "/base/tests/unit/loader/empty.js";
return obj;
}, {});
const cssProxies = glob.sync("src/css/**/*.css")
.map((x) => "/base/mock/" + x)
.reduce((obj, val) => {
obj[val] = "/base/tests/unit/loader/empty.css";
return obj;
}, {});
proxies = Object.assign(proxies, cssProxies);
module.exports = function(config) {
if (config.singleRun) {
// when running with `--singleRun=true` instrument:
reporters.push("coverage");
}
// When passed as `--testPath integration` https://github.com/karma-runner/karma/issues/672#issuecomment-204620473
if (config.testPath) {
testPath = config.testPath;
}
console.log(`RUNNING tests under: "tests/${testPath}/*-test.js"`);
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: ".",
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["qunit"],
// list of files / patterns to load in the browser
files: [
// http://karma-runner.github.io/1.0/config/files.html
// serve resources
{ pattern: "node_modules/jquery/dist/jquery.js", included: true, watched: false },
// TODO: because.. jquery-ui package has no bundle
{ pattern: `http://code.jquery.com/ui/1.12.1/jquery-ui${ config.singleRun ? ".min" : "" }.js`, included: true, watched: false },
{ pattern: "node_modules/jquery-mockjax/dist/jquery.mockjax.min.js", included: true, watched: false },
{ pattern: "node_modules/knockout/build/output/knockout-latest.debug.js", included: true, watched: false },
"src/css/themes/infragistics/infragistics.theme.css",
"src/css/structure/modules/*.css",
{ pattern: "src/css/**/*", included: false, served: true },
// Load locale files:
"src/js/modules/i18n/*-en.js",
"src/js/modules/i18n/*-ja.js",
"src/js/modules/i18n/*-bg.js",
"src/js/modules/i18n/*-de.js",
"src/js/modules/i18n/*-es.js",
"src/js/modules/i18n/*-fr.js",
"src/js/infragistics.loader.js",
// core and LoB files:
...filesConfig.coreBundle("src"),
...filesConfig.lobBundle("src"),
"src/js/extensions/infragistics.ui.*.knockout-extensions.js",
//"src/js/modules/i18n/regional/infragistics.ui.regional-i18n.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-ja.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-de.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-fr.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-bg.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-es.js",
"src/js/modules/i18n/regional/infragistics.ui.regional-en.js", // Must be last so EN can stay default
// DV files for zoombar tests:
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/css/structure/modules/infragistics.ui.chart.css", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/i18n/infragistics.dvcommonwidget-en.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.ext_core.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.ext_collections.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.ext_ui.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.dv_core.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.dv_geometry.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_core.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_categorycore.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.dv_jquerydom.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.dvcommonwidget.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.ui.chart.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.ui.chartlegend.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_category.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_rangecategory.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_verticalcategory.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_financial.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_extendedfinancial.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_extendedaxes.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_polar.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_radial.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_scatter.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_stacked.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_annotation.js", included: true, watched: false },
{ pattern: "http://cdn-na.infragistics.com/igniteui/latest/js/modules/infragistics.datachart_interactivity.js", included: true, watched: false },
"http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js",
"tests/unit/common/test-util.js",
"tests/unit/videoplayer/mockVideo.js",
"tests/unit/common/simInteractions.js",
"tests/test-patch.js",
"tests/unit/splitter/jquery.simulate.js",
"tests/unit/upload/mockServerUpload.js",
{ pattern: "tests/unit/loader/empty.*", included: false, served: true, watched: false },
{ pattern: "tests/unit/tree/data/*", included: false, served: true, watched: false },
{ pattern: "tests/unit/tree/images/*", included: false, served: true, watched: false },
{ pattern: "tests/unit/tilemanager/tilemanager/assets/*", included: false, served: true, watched: false },
// Data files
"tests/unit/templating/DB3.js",
"tests/unit/combo/sample-data/local-data.js",
"tests/unit/combo/sample-data/remote-data.js",
// Test files:
//"tests/unit/**/*test*.htm*"
`tests/${testPath}/*-test?(s).js`
],
// https://github.com/karma-runner/karma/issues/421#issuecomment-336284122
crossOriginAttribute: false,
proxies: proxies,
client: {
clearContext: false,
qunit: {
// https://api.qunitjs.com/config/QUnit.config
autostart: false,
//reorder: false,
showUI: true,
testTimeout: 5000,
//fixture: "#qunit-fixture" //https://github.com/karma-runner/karma-qunit/issues/18
}
},
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"src/js/infragistics.loader.js": "coverage",
"src/js/modules/*.js": "coverage",
"src/js/extensions/*.js": "coverage"
},
// https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md
coverageReporter: {
dir : "coverage/",
reporters: [
{
type : "lcov",
subdir: "." // default outputs per-browser folders
},
{ type: "text-summary" }
],
includeAllSources: true
},
// test results reporter to use
// possible values: "dots", "progress"
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: reporters,
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ["Chrome"],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};