-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
78 lines (76 loc) · 1.81 KB
/
karma.conf.js
File metadata and controls
78 lines (76 loc) · 1.81 KB
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
// Copyright (c) 2019 Gonzalo Müller Bravo.
const path = require('path')
const obtainMock = (mock) => path.resolve(__dirname, 'src/test/mocks/', mock + '.mock.js')
module.exports = function(config) {
config.set({
basePath: 'src',
files: ['test/testEntryPoint.js'],
frameworks: ['jasmine'],
browsers: ['jsdom'],
preprocessors: {
'test/testEntryPoint.js': ['webpack']
},
webpack: {
mode: 'development',
resolve: {
alias: {
"@angular-devkit/build-angular": obtainMock('build-angular'),
"path": obtainMock('path')
}
},
module: {
rules: [{
test: /\.m?js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},{
test: /\.m?js$/,
exclude: /(testEntryPoint|\.(mock|test))\.js$/,
use: {
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true
}
},
}]
},
watch: false
},
reporters: ['mocha', 'junit', 'coverage-istanbul'],
junitReporter: {
outputDir: '../build/reports/tests',
outputFile: undefined
},
coverageIstanbulReporter: {
dir: 'build/reports/coverage',
reports: [
'lcov',
'text',
'text-summary'
],
fixWebpackSourcePath: true,
skipFilesWithNoCoverage: true,
thresholds: {
global: {
statements: 95,
branches: 95,
functions: 95,
lines: 95,
},
each: {
statements: 99,
branches: 99,
functions: 99,
lines: 99,
}
}
},
autoWatch: false,
singleRun: true
});
}