This repository was archived by the owner on Jan 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkarma.conf.js
More file actions
56 lines (54 loc) · 1.75 KB
/
karma.conf.js
File metadata and controls
56 lines (54 loc) · 1.75 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
const webpackConfig = require("./webpack.config")[0];
const path = require("path");
Object.assign(webpackConfig, {
devtool: "inline-source-map",
externals: [
"react/lib/ExecutionEnvironment",
"react/lib/ReactContext",
"react/addons",
"jsdom"
]
});
module.exports = function(config) {
if (config.codeCoverage) {
Object.assign(webpackConfig, {
module: Object.assign(webpackConfig.module, {
rules: webpackConfig.module.rules.concat([ {
test: /\.ts$/,
enforce: "post",
loader: "istanbul-instrumenter-loader",
include: path.resolve(__dirname, "src"),
exclude: /\.(spec)\.ts$/
} ])
})
});
}
config.set({
basePath: "",
frameworks: [ "jasmine" ],
files: [
{ pattern: "src/**/*.ts", watched: true, included: false, served: false },
{ pattern: "tests/**/*.ts", watched: true, included: false, served: false },
"tests/test-index.js"
],
exclude: [],
preprocessors: { "tests/test-index.js": [ "webpack", "sourcemap" ] },
webpack: webpackConfig,
webpackServer: { noInfo: true },
reporters: [ "progress", config.codeCoverage ? "coverage" : "kjhtml" ],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: [ "Chrome" ],
singleRun: false,
concurrency: Infinity,
coverageReporter: {
dir: "./dist/testresults",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "text" }
]
}
});
};