-
Notifications
You must be signed in to change notification settings - Fork 75
/
karma.conf.ts
56 lines (51 loc) · 1.25 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
// eslint-disable-next-line unicorn/prefer-module
module.exports = (cfg) => {
cfg.set({
browsers: ['ChromeHeadless'],
singleRun: true,
autoWatch: false,
frameworks: ['jasmine', 'karma-typescript'],
reporters: ['progress', 'karma-typescript'],
preprocessors: {
'**/*.ts': 'karma-typescript',
'**/*.tsx': 'karma-typescript',
},
files: ['./src/**/*.ts', './src/**/*.tsx', './tests/**/*.spec.ts', './tests/**/*.spec.tsx'],
client: {
jasmine: {
random: false,
},
},
karmaTypescriptConfig: {
bundlerOptions: {
constants: {
'process.env': {
NODE_ENV: 'production',
},
},
},
compilerOptions: {
target: 'es2017',
module: 'commonjs',
moduleResolution: 'node',
jsx: 'react',
lib: ['dom', 'es2017'],
},
coverageOptions: {
exclude: /(node_modules|tests|spec)/i,
},
reports: {
lcovonly: {
directory: './coverage',
subdirectory: () => '',
filename: 'lcov.info',
},
html: {
directory: './coverage',
subdirectory: () => '',
},
},
include: ['./src/**/*', './tests/**/*'],
},
});
};