/
karma.conf.js
61 lines (60 loc) · 1.73 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
// var webpackConfig = require('./webpack.config.js');
// var webpack = require('webpack');
// var path = require('path');
// const process = require('process');
process.env.LANGUAGE = 'en_US';
process.env.TZ = 'UTC';
module.exports = function(config) {
config.set({
browsers: ['ChromeHeadless'],
frameworks: ['mocha', 'karma-typescript'],
reporters: ['progress', 'coverage', 'karma-typescript'],
files: [
{ pattern: 'src/**/*.ts' },
{ pattern: 'test/**/*.ts' },
],
preprocessors: {
'src/**/!(Sanitize).ts': ['karma-typescript', "coverage"],
'src/**/Sanitize.ts': ['karma-typescript'],
'test/**/*.ts': ['karma-typescript'],
},
karmaTypescriptConfig: {
bundlerOptions: {
transforms: [require("karma-typescript-es6-transform")()],
}
},
// webpack: {
// mode: 'development',
// module: {
// rules: webpackConfig[2].module.rules.concat({
// test: /\.ts$/,
// use: 'ts-loader'
// }, {
// test: /\.ts$/,
// exclude: [ path.resolve(__dirname, "src", "test") ],
// enforce: 'post',
// use: {
// loader: 'istanbul-instrumenter-loader',
// options: { esModules: true }
// }
// })
// },
// devtool: "inline-source-map",
// resolve: {
// extensions: [".ts"],
// }
// },
// webpackMiddleware: {
// noInfo: true,
// },
// coverageIstanbulReporter: {
// reports: [ 'html', 'text-summary', 'lcovonly' ],
// dir: path.join(__dirname, 'coverage'),
// fixWebpackSourcePaths: true,
// 'report-config': {
// html: { outdir: 'html' }
// }
// },
singleRun: true,
});
};