-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.browser.conf.js
50 lines (41 loc) · 1.08 KB
/
karma.browser.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
const enableCoverage = process.env.TEST_BROWSER_COVERAGE?.toLowerCase() === "true";
module.exports = function(config) {
config.set({
frameworks: ["mocha", "chai", "webpack"],
files: [
{ pattern: "test/browser/index.ts", watched: false },
{ pattern: "test/data/**", included: false, watched: false, served: true },
],
preprocessors: {
["test/**/*.ts"]: ["webpack", "sourcemap"],
["lib/esm/**/*.js"]: ["sourcemap"],
},
mime: {
"text/x-typescript": ["ts", "tsx"],
},
webpack: new require("./webpack.karma.browser.config.js").constructor({ enableCoverage }),
webpackMiddleware: {
noInfo: true,
},
client: {
mocha: {
timeout: 30000,
},
},
reporters: [
"progress",
...(enableCoverage ? ["coverage-istanbul"] : []),
],
...(enableCoverage
? {
coverageIstanbulReporter: {
reports: ["text-summary", "lcov"],
dir: "coverage/browser",
skipFilesWithNoCoverage: true,
},
}
: {}
),
singleRun: true,
});
};