forked from nbfontana/ngx-currency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.ts
86 lines (81 loc) · 2.05 KB
/
karma.conf.ts
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
import * as webpack from 'webpack';
import * as path from 'path';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
export default config => {
config.set({
basePath: './',
frameworks: ['mocha'],
files: [
'test/entry.ts'
],
preprocessors: {
'test/entry.ts': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: /\.ts$/,
loader: 'tslint-loader',
exclude: /node_modules/,
enforce: 'pre',
options: {
emitErrors: config.singleRun,
failOnHint: config.singleRun
}
}, {
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
transpileOnly: !config.singleRun
}
}, {
test: /src\/.+\.ts$/,
exclude: /(node_modules|\.spec\.ts$)/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post'
}]
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: null,
test: /\.(ts|js)($|\?)/i
}),
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)@angular/,
path.join(__dirname, 'src')
),
...(config.singleRun ? [
new webpack.NoEmitOnErrorsPlugin()
] : [
new ForkTsCheckerWebpackPlugin({
watch: ['./src', './test']
})
])
]
},
mochaReporter: {
showDiff: true,
output: 'autowatch'
},
coverageIstanbulReporter: {
reports: ['text-summary', 'html', 'lcovonly'],
fixWebpackSourcePaths: true
},
mime: {
'text/x-typescript': ['ts']
},
reporters: ['mocha', 'coverage-istanbul'],
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless','ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
}
});
};