This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
karma.conf.js
78 lines (70 loc) · 1.78 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
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const path = require('path');
const webpack = require('webpack');
module.exports = config => {
config.set({
basePath: 'lib',
frameworks: [
'jasmine'
],
files: [
{pattern: '**/*.spec.ts'}
],
preprocessors: {
'**/*.ts': 'webpack'
},
webpack: {
mode: 'development',
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {'buffer': require.resolve('buffer/')}
},
// Ensure buffer is available
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
],
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader'
},
{
test: /\.ts$/,
use: {loader: 'istanbul-instrumenter-loader'},
enforce: 'post',
exclude: /\.spec\.ts$/
}
]
}
},
webpackMiddleware: {
noInfo: true
},
reporters: ['dots', 'coverage-istanbul'],
// https://www.npmjs.com/package/karma-coverage-istanbul-reporter
coverageIstanbulReporter: {
dir: path.join(__dirname, 'coverage'),
reports: ['text-summary', 'lcovonly'],
fixWebpackSourcePaths: true,
'report-config': {
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}
},
combineBrowserReports: true // Combines coverage information from multiple browsers into one report
},
mocha: {
timeout: 20000 // 20 seconds
},
//autoWatch: true,
browsers: ['Chrome'],
colors: true
});
};