-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
54 lines (53 loc) · 1.27 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
const webpack = require("webpack");
// mobx fix: Fix "there are multiple mobx instances active" error:
// https://github.com/mobxjs/mobx/issues/1097#issuecomment-323698853
module.exports = function(config) {
config.set({
frameworks: ["jasmine"],
reporters: ["junit", "progress"],
customLaunchers: {
// Until a headless option is added:
// https://github.com/karma-runner/karma-firefox-launcher/issues/76
FirefoxHeadless: {
base: "Firefox",
flags: ["-headless"],
},
},
files: [
"node_modules/mobx/lib/mobx.umd.js", // mobx fix
"src/**/*.spec.ts",
],
mime: {
"text/x-typescript": ["ts", "tsx"],
},
preprocessors: {
"**/*.spec.ts": ["webpack", "sourcemap"],
},
junitReporter: {
outputDir: "junit/karma",
outputFile: "results.xml",
},
webpack: {
externals: ["mobx"], // mobx fix
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: ["babel-loader", "ts-loader"],
},
],
},
plugins: [
// Partially fix source maps with Typescript:
// https://github.com/webpack-contrib/karma-webpack/issues/109#issuecomment-224961264
new webpack.SourceMapDevToolPlugin({
filename: null,
test: /\.[jt]sx?($|\?)/i,
}),
]
},
});
};