forked from hotwired/stimulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.cjs
131 lines (117 loc) · 2.77 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
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",
version: "latest"
},
sl_chrome_latest_i8n: {
base: "SauceLabs",
browserName: "chrome",
version: "latest",
chromeOptions: {
args: ["--lang=tr"]
}
},
sl_firefox_65: {
base: "SauceLabs",
browserName: "firefox",
version: "65.0"
},
sl_firefox_latest: {
base: "SauceLabs",
browserName: "firefox",
version: "latest"
},
sl_safari_12_1: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.13",
version: "12.1"
},
sl_safari_latest_catalina: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.15",
version: "latest"
},
sl_safari_latest_big_sur: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 11",
version: "latest"
},
sl_edge_79: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "79.0"
},
sl_edge_latest: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest"
},
sl_ios_latest: {
base: "SauceLabs",
browserName: "safari",
platform: "ios",
device: "iPhone X Simulator",
version: "13.0"
},
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)
}