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 10
/
karma.conf.js
90 lines (84 loc) · 2.29 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"use strict";
// Minimal localConfig if there is not one locally.
let localConfig = {
browserStack: {},
};
try {
// eslint-disable-next-line import/no-unresolved, global-require
localConfig = require("./localConfig");
}
catch (ex) {} // eslint-disable-line no-empty
module.exports = function configure(config) {
const options = {
basePath: "",
frameworks: ["mocha", "chai", "source-map-support"],
files: [
"build/dist/salve.min.js",
"browser-test/**/*.js",
{ pattern: "build/dist/**/*.map", included: false },
{ pattern: "lib/salve/schemas/relaxng.rng", included: false },
{ pattern: "test/salve-convert/basename.rng", included: false },
{ pattern: "test/salve-convert/subdir/sub.rng", included: false },
],
exclude: [],
preprocessors: {},
reporters: ["mocha"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ["ChromeHeadless", "FirefoxHeadless"],
browserStack: {
project: "salve",
},
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,
concurrency: Infinity,
};
// Get the options from the localConfig file.
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));
// We must modify this array in place.
browsers.splice(...[0, browsers.length].concat(newList));
}
config.set(options);
};