-
Notifications
You must be signed in to change notification settings - Fork 10
/
karma.conf.js
62 lines (52 loc) · 1.54 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
// Karma config
// https://karma-runner.github.io/0.12/config/configuration-file.html
// https://jstools.dev/karma-config/
"use strict";
const { host } = require("@jsdevtools/host-environment");
const browsers = ["ChromeWithoutSecurity"];
module.exports = (cfg) => {
cfg.set({
reporters: ["verbose", "coverage-istanbul"],
browsers,
frameworks: ["mocha"],
client: {
mocha: {
timeout: 60000, // 60 seconds - upped from 2 seconds
},
},
files: ["test/specs/!(file-system.spec).js"],
preprocessors: {
// Uses Webpack to bundle your tests and their dependencies
"test/**/*.+(spec|test).+(js|jsx|mjs)": ["webpack"],
},
webpack: {
// Webpack development mode it easier to debug failing tests
mode: "development",
// Inlne source maps ensure proper stack traces in errors,
// and allow you to debug your original source code rather than bundled code.
devtool: "inline-source-map",
module: {
rules: [
{
test: /\.(js|jsx|mjs)$/,
include: /esm/,
exclude: /node_modules|\.spec\.|\.test\./,
enforce: "post",
use: "@jsdevtools/coverage-istanbul-loader",
},
],
},
},
coverageIstanbulReporter: {
dir: "coverage/%browser%",
reports: ["text-summary", "lcov"],
skipFilesWithNoCoverage: true,
},
customLaunchers: {
ChromeWithoutSecurity: {
base: "ChromeHeadless",
flags: ["--disable-web-security"],
},
},
});
};