-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
73 lines (70 loc) · 1.67 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
64
65
66
67
68
69
70
71
72
73
'use strict'
const IS_COVERAGE = !!process.env.IS_COVERAGE
const IS_TRAVIS = !!process.env.TRAVIS
module.exports = function (config) {
config.set({
basePath: '.',
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-mocha-reporter',
'karma-typescript',
],
logLevel: 'info',
frameworks: ['jasmine', 'karma-typescript'],
browsers: [IS_TRAVIS ? 'Firefox' : 'Chrome'],
files: [
{
pattern: 'src/**/*.ts',
watched: true,
served: true,
included: true,
},
],
exclude: [],
preprocessors: {
'**/*.ts': ['karma-typescript'],
},
reporters: [
// 'progress',
'mocha',
'karma-typescript',
],
mochaReporter: {
output: 'minimal',
},
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /(\.spec\.ts)$/,
sourceMap: true,
validateSyntax: false,
},
exclude: ['dist'],
// compilerOptions: tsconfig.compilerOptions,
tsconfig: './tsconfig.cjs.json',
converageOptions: {
instrumentation: IS_COVERAGE,
exclude: /\.(d|spec|test)\.ts/i,
instrumenterOptions: {
// a regex for excluding files from remapping
// exclude: '',
// a function for handling error messages
warn: (msg) => console.log(msg),
},
},
reports: {
'text-summary': '',
html: {
directory: 'coverage',
subdirectory: 'html',
},
lcovonly: {
directory: 'coverage',
subdirectory: 'lcov',
filename: 'lcov.info',
},
},
},
})
}