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 6
/
karma-common.conf.js
129 lines (122 loc) · 3.38 KB
/
karma-common.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"use strict";
module.exports = (config) => {
const options = {
basePath: ".",
frameworks: ["mocha", "chai", "source-map-support"],
client: {
mocha: {
grep: config.grep,
},
},
reportSlowerThan: 200,
files: [
"node_modules/systemjs/dist/system.js",
"test/karma-main.js",
{ pattern: "build/dist/**/*.@(js|json|map)", included: false },
{ pattern: "build/test-files/**/*", included: false },
{ pattern: "test/**/*.ts", included: false },
{ pattern: "test/schemas/*.js", included: false },
{
pattern: "node_modules/salve/@(*.js|*.map|package.json)",
included: false,
},
{
pattern: "node_modules/systemjs-plugin-text/@(*.js|package.json)",
included: false,
},
],
exclude: [],
preprocessors: {
"test/**/*.ts": ["typescript"],
},
typescriptPreprocessor: {
tsconfigPath: "./test/tsconfig.json",
compilerOptions: {
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
typescript: require("typescript"),
sourceMap: false,
// We have to have them inline for the browser to find them.
inlineSourceMap: true,
inlineSources: true,
},
},
reporters: ["mocha"],
mochaReporter: {
showDiff: true,
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browserStack: {
project: "salve-dom",
},
browsers: ["ChromeHeadless", "FirefoxHeadless"],
customLaunchers: {
ChromeWin: {
base: "BrowserStack",
browser: "Chrome",
os: "Windows",
os_version: "10",
},
FirefoxWin: {
base: "BrowserStack",
browser: "Firefox",
os: "Windows",
os_version: "10",
},
Edge: {
base: "BrowserStack",
browser: "Edge",
os: "Windows",
os_version: "10",
},
Opera: {
base: "BrowserStack",
browser: "Opera",
os: "Windows",
os_version: "10",
},
SafariHighSierra: {
base: "BrowserStack",
browser: "Safari",
os: "OS X",
os_version: "High Sierra",
},
SafariSierra: {
base: "BrowserStack",
browser: "Safari",
os: "OS X",
os_version: "Sierra",
},
},
singleRun: false,
};
let localConfig = {
browserStack: {},
};
if (process.env.CONTINUOUS_INTEGRATION) {
// Running on Travis. The user id and key are taken from the environment.
localConfig.browserStack.startTunnel = true;
}
else {
// Running outside Travis: we get our configuration from ./local-config, if
// it exists.
try {
// eslint-disable-next-line import/no-unresolved, global-require
localConfig = require("./local-config");
}
catch (ex) {} // eslint-disable-line no-empty
}
// Merge the browserStack configuration we got with the base values in our
// config.
Object.assign(options.browserStack, localConfig.browserStack);
const { browsers } = config;
if (browsers.length === 1 && browsers[0] === "all") {
const newList = options.browsers.concat(Object.keys(options.customLaunchers));
// Yes, we must modify this array in place.
// eslint-disable-next-line prefer-spread
browsers.splice.apply(browsers, [0, browsers.length].concat(newList));
}
return options;
};