-
Notifications
You must be signed in to change notification settings - Fork 88
/
karma.conf.cjs
44 lines (41 loc) · 1.2 KB
/
karma.conf.cjs
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
const playwright = require("playwright");
process.env.WEBKIT_HEADLESS_BIN = playwright.webkit.executablePath();
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
const IS_COVERAGE = process.env.NODE_ENV === "coverage";
module.exports = (config) => {
config.set({
basePath: "./",
frameworks: ["jasmine"],
reporters: ["dots"].concat(IS_COVERAGE ? ["coverage"] : []),
browsers: IS_COVERAGE
? ["ChromeHeadless"]
: ["WebkitHeadless", "ChromeHeadless", "FirefoxHeadless"],
client: {
captureConsole: false,
jasmine: {
timeoutInterval: 10000,
random: false,
},
},
files: [
{ pattern: "src/**/*.js", type: "module" },
{ pattern: "test/**/*.js", type: "module" },
],
preprocessors: {
"src/**/*.js": IS_COVERAGE ? ["coverage"] : [],
},
coverageReporter: {
dir: "coverage/",
reporters: [
{ type: "html", subdir: "html" },
{ type: "lcovonly", subdir: "lcov", file: "lcov.info" },
],
},
autoWatch: true,
singleRun: true,
concurrency: Infinity,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 1,
port: 9876 + Number(IS_COVERAGE),
});
};