-
Notifications
You must be signed in to change notification settings - Fork 33
/
karma.config.js
126 lines (121 loc) · 3.07 KB
/
karma.config.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
/* eslint-env node */
const path = require(`path`);
process.env.CHROME_BIN = require(`puppeteer`).executablePath();
process.env.FIREFOX_BIN = require(`playwright`).firefox.executablePath();
const SAUCE = parseInt(process.env.SAUCE, 10) >= 1;
// Check out https://saucelabs.com/platforms for all browser/platform combos
const sauceLaunchers = {
sl_chrome_latest: {
base: `SauceLabs`,
browserName: `chrome`,
browserVersion: `latest`,
platformName: `macOS 12`,
'sauce:options': {
extendedDebugging: true,
},
},
sl_chrome_old: {
base: `SauceLabs`,
browserName: `chrome`,
browserVersion: `90`,
platformName: `macOS 10.13`,
'sauce:options': {
extendedDebugging: true,
},
},
sl_firefox_latest: {
base: `SauceLabs`,
browserName: `firefox`,
browserVersion: `latest`,
platformName: `macOS 12`,
'sauce:options': {
extendedDebugging: true,
},
},
sl_firefox_old: {
base: `SauceLabs`,
browserName: `firefox`,
browserVersion: `91`,
platformName: `macOS 10.13`,
'sauce:options': {
extendedDebugging: true,
},
},
sl_safari_latest: {
base: `SauceLabs`,
browserName: `safari`,
browserVersion: `latest`,
platformName: `macOS 12`,
},
sl_safari_old: {
base: `SauceLabs`,
browserName: `safari`,
browserVersion: `13`,
platformName: `macOS 10.13`,
},
sl_edge_latest: {
base: `SauceLabs`,
browserName: `MicrosoftEdge`,
browserVersion: `latest`,
platformName: `Windows 10`,
},
sl_edge_old: {
base: `SauceLabs`,
browserName: `MicrosoftEdge`,
browserVersion: `90`,
platformName: `Windows 10`,
},
};
const sauceBrowsers = Object.keys(sauceLaunchers);
// shared config for all unit tests
module.exports = function (config) {
config.set({
frameworks: [`mocha`],
preprocessors: {
'**/*.js': [`sourcemap`],
},
basePath: path.resolve(__dirname, `test/browser/build`),
retryLimit: 2,
files: [`bundle.js`],
client: {
clientDisplayNone: true,
mocha: {
timeout: 30000, // 300s
},
},
sauceLabs: {
public: `team`,
build: `panel ${process.env.GITHUB_REF || `local`} build ${process.env.GITHUB_RUN_NUMBER || ``}`,
testName: `Panel tests`,
},
plugins: [
require(`karma-mocha`),
require(`karma-spec-reporter`),
require(`karma-chrome-launcher`),
require(`karma-firefox-launcher`),
require(`karma-sauce-launcher`),
require(`karma-sourcemap-loader`),
],
browsers: SAUCE ? sauceBrowsers : [`ChromeHeadless`, `Firefox`],
reporters: SAUCE ? [`spec`, `saucelabs`] : [`spec`],
singleRun: true,
customLaunchers: {
...sauceLaunchers,
ChromeHeadless: {
base: `Chrome`,
flags: [
`--headless`,
`--disable-gpu`,
`--disable-dev-shm-usage`,
`--remote-debugging-port=9222`,
`--window-size=1280,800`,
`--no-sandbox`,
],
},
FirefoxHeadless: {
base: `Firefox`,
flags: [`-headless`],
},
},
});
};