-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathkarma.conf.js
63 lines (60 loc) · 1.97 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
const realBrowser = String(process.env.BROWSER).match(/^(1|true)$/gi)
const localLaunchers = {
ChromeNoSandboxHeadless: {
base: "Chrome",
flags: [
"--no-sandbox",
"--disable-setuid-sandbox",
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
"--headless",
"--disable-gpu",
"--no-gpu",
// Without a remote debugging port, Google Chrome exits immediately.
"--remote-debugging-port=9333"
]
}
};
const browsers = realBrowser ? ["Chrome"] : Object.keys(localLaunchers)
module.exports = (config) => {
const env = process.env["NODE_ENV"] || "development"
config.set({
frameworks: ["jasmine", "karma-typescript"],
plugins: [
"karma-jasmine",
"karma-typescript",
"karma-chrome-launcher",
"karma-jasmine-html-reporter",
"karma-spec-reporter"
],
client: {
// leave Jasmine Spec Runner output visible in browser
clearContext: false
},
files: [{ pattern: "src/**/*.ts" }, { pattern: "test/**/*.spec.ts" }],
preprocessors: {
"**/*.ts": ["karma-typescript"],
"test/**/*.spec.ts": ["karma-typescript"]
},
karmaTypescriptConfig: {
compilerOptions: {
lib: [
"ES2017",
"DOM",
"ES2015.Generator",
"ES2015.Iterable",
"ES2015.Promise",
"ES2015.Symbol",
"ES2015.Symbol.WellKnown",
"ESNext.AsyncIterable"
]
}
},
reporters: ["progress", "kjhtml"],
colors: true,
logLevel: env === "debug" ? config.LOG_DEBUG : config.LOG_INFO,
autoWatch: true,
browsers: browsers,
customLaunchers: localLaunchers,
singleRun: false
})
}