This repository was archived by the owner on Jul 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathkarma.conf.js
95 lines (72 loc) · 1.87 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
const path = require('path')
const webpackTestConfig = require('./webpack.config')
webpackTestConfig.entry = './test/spec.entry.ts'
module.exports = function (config) {
config.set({
basePath: process.cwd(),
frameworks: ['mocha', 'chai', 'sinon'],
files: [
'./test/spec.entry.ts'
],
preprocessors: {
'./test/spec.entry.ts': [
'webpack'
]
},
webpack: webpackTestConfig,
webpackMiddleware: {
noInfo: true,
quiet: false,
stats: 'errors-only'
},
reporters: [
'mocha',
'coverage-istanbul'
],
coverageIstanbulReporter: {
// reports can be any that are listed here: https://github.com/istanbuljs/istanbul-reports/tree/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib
reports: ['html', 'lcov', 'text-summary', 'json'],
// base output directory
dir: path.join(process.cwd(), 'coverage'),
// if using webpack and pre-loaders, work around webpack breaking the source path
fixWebpackSourcePaths: true,
'report-config': {
html: {
subdir: 'html'
}
},
thresholds: {
statements: 90,
lines: 95,
branches: 95,
functions: 95
}
},
port: 9876,
colors: true,
singleRun: process.env.NODE_ENV === 'test',
logLevel: config.LOG_WARN,
browsers: [ process.env.NODE_ENV === 'test' ? 'Chrome_without_sandbox' : 'Chrome'],
captureTimeout: 60000,
plugins: [
'karma-chai',
'karma-mocha',
'karma-sinon',
'karma-mocha-reporter',
'karma-chrome-launcher',
'karma-coverage-istanbul-reporter',
'karma-webpack'
],
mime: {
'text/x-typescript': ['ts', 'tsx']
},
customLaunchers: {
Chrome_without_sandbox: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox'
]
}
}
})
}