forked from Azure/BatchExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
73 lines (65 loc) · 2.03 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
62
63
64
65
66
67
68
69
70
71
72
73
const webpackConfig = require("./config/webpack.config.test");
// Only enable coverage if env is defined(So we don't enable it in watch mode as it duplicate logs)
const coverageReporters = process.env.COVERAGE ? ["coverage", "remap-coverage"] : [];
// Karma config for testing the code running the browser environemnt.
// For the client testing use the mocha command line.
module.exports = function(config) {
config.set({
basePath: ".",
frameworks: ["jasmine"],
files: [{
pattern: "./test/app/spec-entry.js",
watched: false
}, ],
// proxied base paths
proxies: {},
port: 9876,
logLevel: config.LOG_INFO,
browserConsoleLogOptions: {
level: "log",
},
colors: true,
autoWatch: false,
autoWatchBatchDelay: 1000,
browsers: ["CustomElectron"],
browserNoActivityTimeout: 300000,
customLaunchers: {
CustomElectron: {
base: "Electron",
flags: ["--show", "--enable-precise-memory-info"]
}
},
electronOpts: {
title: "Banana",
"webPreferences": {
"blinkFeatures": "PreciseMemoryInfo"
}
},
// Coverage reporter generates the coverage
reporters: ["mocha", ...coverageReporters],
preprocessors: {
"test/app/spec-entry.js": ["coverage", "webpack", "sourcemap"],
},
client: {
useIframe: false,
},
webpack: webpackConfig,
webpackMiddleware: {
stats: "errors-only",
},
browserDisconnectTimeout: "4000",
singleRun: true,
mochaReporter: {
output: "autowatch",
reportSlowerThan: 200,
},
coverageReporter: {
type: "in-memory"
},
remapCoverageReporter: {
"text-summary": null,
json: "./coverage/coverage.json",
html: "./coverage/html"
},
});
};