This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
76 lines (74 loc) · 2.22 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
74
75
76
/* eslint-env node, commonjs */
"use strict";
module.exports = function configure(config) {
config.set({
basePath: "",
frameworks: ["mocha", "chai", "fixture"],
client: {
mocha: {
asyncOnly: true,
grep: config.grep,
},
},
files: [
"node_modules/core-js/client/core.min.js",
"node_modules/requirejs/require.js",
"sitestatic/config/requirejs-config-dev.js",
"test-main.js",
"node_modules/@babel/polyfill/dist/polyfill.js",
{
pattern: "sitestatic/lib/**/@(*.html|*.hbs|*.js|*.json)",
included: false,
},
{ pattern: "sitestatic/js/**/*.js", included: false },
{ pattern: "build/test-data/**/*", included: false },
{ pattern: "karma_tests/**/*.js", included: false },
{ pattern: "karma_tests/**/*.json" },
{ pattern: "semantic_fields/karma_tests/**/*.js", included: false },
{ pattern: "lexicography/karma_tests/**/*.js", included: false },
{ pattern: "lexicography/templates/lexicography/viewer.html" },
{ pattern: "node_modules/sinon/pkg/**/*.js", included: false },
],
exclude: [],
preprocessors: {
"**/karma_tests/*.html": ["html2js"],
"**/templates/**/*.html": ["html2js"],
"**/karma_tests/**/*.json": ["json_fixtures"],
"karma_tests/lib/btw/semantic_field_editor/**/*.js": ["babelModule"],
"karma_tests/lib/testutils/**/*.js": ["babelModule"],
},
jsonFixturesPreprocessor: {
variableName: "__json__",
},
customPreprocessors: {
babelModule: {
base: "babel",
options: {
plugins: ["@babel/plugin-transform-modules-amd"],
},
},
},
babelPreprocessor: {
options: {
presets: ["@babel/preset-env"],
ignore: [
"node_modules",
],
sourceMap: "inline",
},
filename: function filename(file) {
return file.originalPath.replace(/\.js$/, ".es5.js");
},
sourceFileName: function sourceFileName(file) {
return file.originalPath;
},
},
// reporters: ["mocha"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ["ChromeHeadless"],
singleRun: false,
});
};