forked from hybridsjs/hybrids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.cjs
109 lines (105 loc) · 2.59 KB
/
karma.conf.cjs
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
const IS_COVERAGE = process.env.NODE_ENV === "coverage";
const IS_SAUCE_LABS =
!IS_COVERAGE &&
!!process.env.TRAVIS &&
process.env.TRAVIS_BRANCH === "master" &&
process.env.TRAVIS_PULL_REQUEST === "false";
const customLaunchers = {
SL_Chrome: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 10",
version: "latest",
},
SL_Chrome_1: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 10",
version: "latest-1",
},
SL_Firefox: {
base: "SauceLabs",
browserName: "firefox",
platform: "Windows 10",
version: "latest",
},
SL_Firefox_1: {
base: "SauceLabs",
browserName: "firefox",
platform: "Windows 10",
version: "latest-1",
},
SL_Safari: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 11.00",
version: "latest",
},
SL_Safari_1: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.15",
version: "latest",
},
SL_EDGE: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest",
},
SL_EDGE_1: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest-1",
},
SL_iOS: {
base: "SauceLabs",
browserName: "iphone",
platform: "macOS 11.00",
version: "latest",
},
SL_iOS_1: {
base: "SauceLabs",
browserName: "iphone",
platform: "macOS 11.00",
version: "latest-1",
},
};
const reporters = ["dots"];
if (IS_COVERAGE) reporters.push("coverage");
if (IS_SAUCE_LABS) reporters.push("saucelabs");
module.exports = config => {
config.set({
basePath: "./",
frameworks: ["jasmine"],
reporters,
browsers: IS_SAUCE_LABS ? Object.keys(customLaunchers) : ["ChromeHeadless"],
files: [
"node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
{ pattern: "src/**/*.js", type: "module" },
{ pattern: "test/**/*.js", type: "module" },
],
preprocessors: {
"src/**/*.js": IS_COVERAGE ? ["coverage"] : [],
},
coverageReporter: {
dir: "coverage/",
reporters: [
{ type: "html", subdir: "report-html" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
],
},
captureTimeout: 120000,
browserNoActivityTimeout: 300000,
browserDisconnectTolerance: 2,
customLaunchers,
sauceLabs: {
testName: "Hybrids Unit Tests",
build: `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
},
autoWatch: true,
singleRun: false,
});
};