-
Notifications
You must be signed in to change notification settings - Fork 5
/
karma.conf.ts
71 lines (64 loc) · 1.71 KB
/
karma.conf.ts
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
import * as karma from "karma";
process.env.CHROME_BIN = require('puppeteer').executablePath();
const TIMEOUT_FACTOR = process.env.TRAVIS_JOB_NUMBER ? 20 : 1;
let configData: any = {
frameworks: ["mocha", "chai", "karma-typescript", "promise"],
files: [
"src/**/*.ts"
],
preprocessors: {
"src/**/*.ts'": ["karma-typescript"],
'src/**/*!(*.spec).ts': ["karma-typescript"]
},
client: {
captureConsole: true,
mocha: {
timeout: TIMEOUT_FACTOR * 4000,
retries: 4,
}
},
autoWatch: false,
singleRun: true,
concurrency: 4,
reporters: [/*"progress",*/ "helpful", "karma-typescript"],
browsers: ["ChromeHeadlessNoSandbox", "PhantomJS"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
karmaTypescriptConfig: {
bundlerOptions: {
addNodeGlobals: false,
ignore: ["ws"],
sourceMap: true,
constants: {
TIMEOUT_FACTOR: TIMEOUT_FACTOR,
},
},
reports: {
"lcovonly": {
"filename": "report.lcov"
},
"html": "coverage",
"text-summary": ""
},
coverageOptions: {
exclude: /\.spec\.ts$/i
},
compilerOptions: {
"lib": [
"es5",
"dom",
"es2015.promise"
]
},
},
captureTimeout: 0,
browserNoActivityTimeout: 120000,
};
const karmaConfig = (config: karma.Config): void => {
config.set(configData as any);
};
export default karmaConfig;