-
Notifications
You must be signed in to change notification settings - Fork 424
/
karma.conf.cjs
138 lines (123 loc) · 3.13 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
const config = {
basePath: ".",
browsers: ["ChromeHeadless"],
frameworks: ["qunit"],
reporters: ["progress"],
singleRun: true,
autoWatch: false,
files: [
"dist/tests/index.js",
{ pattern: "src/tests/fixtures/**/*", watched: true, served: true, included: false },
{ pattern: "dist/tests/fixtures/**/*", watched: true, served: true, included: false },
],
preprocessors: {
"dist/tests/**/*.js": ["webpack"],
},
webpack: {
mode: "development",
resolve: {
extensions: [".js"]
}
},
client: {
clearContext: false,
qunit: {
showUI: true
}
},
hostname: "0.0.0.0",
captureTimeout: 180000,
browserDisconnectTimeout: 180000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 300000
}
if (process.env.CI) {
config.customLaunchers = {
sl_chrome_latest: {
base: "SauceLabs",
browserName: "chrome",
browserVersion: "latest"
},
sl_chrome_latest_i8n: {
base: "SauceLabs",
browserName: "chrome",
browserVersion: "latest",
"goog:chromeOptions": {
args: ["--lang=tr"]
}
},
sl_firefox_65: {
base: "SauceLabs",
browserName: "firefox",
browserVersion: "65.0"
},
// Context:
// https://github.com/karma-runner/karma-sauce-launcher/issues/275
// https://saucelabs.com/blog/update-firefox-tests-before-oct-4-2022
sl_firefox_latest: {
base: "SauceLabs",
browserName: "firefox",
browserVersion: "latest",
"moz:debuggerAddress": true
},
sl_safari_12_1: {
base: "SauceLabs",
browserName: "safari",
platformName: "macOS 10.13",
browserVersion: "12.1"
},
sl_safari_latest_catalina: {
base: "SauceLabs",
browserName: "safari",
platformName: "macOS 10.15",
browserVersion: "latest"
},
sl_safari_latest_big_sur: {
base: "SauceLabs",
browserName: "safari",
platformName: "macOS 11",
browserVersion: "latest"
},
sl_edge_79: {
base: "SauceLabs",
browserName: "microsoftedge",
platformName: "Windows 10",
browserVersion: "79.0"
},
sl_edge_latest: {
base: "SauceLabs",
browserName: "microsoftedge",
platformName: "Windows 10",
browserVersion: "latest"
},
// TODO: migrate to W3C capabilities
sl_ios_latest: {
base: "SauceLabs",
browserName: "safari",
platform: "ios",
device: "iPhone X Simulator",
version: "13.0"
},
// TODO: migrate to W3C capabilities
sl_android_latest: {
base: "SauceLabs",
browserName: "chrome",
platform: "android",
device: "Android GoogleAPI Emulator",
version: "10.0"
}
}
config.browsers = Object.keys(config.customLaunchers)
config.reporters = ["dots", "saucelabs"]
config.sauceLabs = {
testName: "Stimulus Browser Tests",
[atob("dXNlcm5hbWU=")]: atob("c3RpbXVsdXM="),
[atob("YWNjZXNzS2V5")]: atob("NDI2NzMxMzUtYTViYy00ODlhLThlYTktMDY4MmMzYjcyMjRh")
}
function atob(a) {
return Buffer.from(a, "base64").toString()
}
}
module.exports = function (karmaConfig) {
karmaConfig.set(config)
}