-
Notifications
You must be signed in to change notification settings - Fork 122
/
karma.conf.js
76 lines (70 loc) · 1.75 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
74
75
76
'use strict'
const IS_COVERALLS = !!process.env.IS_COVERALLS
const IS_COVERAGE = IS_COVERALLS || !!process.env.IS_COVERAGE
const IS_TRAVIS = !!process.env.TRAVIS
const tsconfig = require('./tsconfig.json')
module.exports = (config) => {
config.set({
plugins: [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-safari-launcher',
'karma-typescript',
'karma-mocha-reporter',
],
logLevel: 'info',
frameworks: [
'jasmine',
'karma-typescript',
],
browsers: [
IS_TRAVIS ? 'Firefox' : 'Chrome'
],
files: [
'node_modules/jquery/dist/jquery.js',
'src/**/*.ts',
],
preprocessors: {
'**/*.ts': ['karma-typescript'],
},
reporters: [
'mocha',
'karma-typescript',
],
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.test\.ts$/,
sourceMap: true,
validateSyntax: false,
},
exclude: ['node_modules', 'release'],
// compilerOptions: tsconfig.compilerOptions,
tsconfig: 'tsconfig.cjs.json',
// tsconfig: 'tsconfig.json',
// Pass options to remap-istanbul.
remapOptions: {
// a regex for excluding files from remapping
// exclude: '',
// a function for handling error messages
warn: (msg) => console.log(msg)
},
converageOptions: {
instrumentation: IS_COVERAGE,
exclude: /\.(d|spec|test)\.ts/i,
},
reports: {
'text-summary': '',
html: {
directory: 'coverage',
subdirectory: 'html',
},
lcovonly: {
directory: 'coverage',
subdirectory: 'lcov',
},
},
},
})
}