-
Notifications
You must be signed in to change notification settings - Fork 15
/
karma.browserstack.js
65 lines (58 loc) · 1.59 KB
/
karma.browserstack.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
// Karma configuration
// eslint-disable-next-line import/no-extraneous-dependencies
const { short } = require('git-rev-sync');
const getGlobalConfig = require('./karma.global.js');
const packageJson = require('./package.json');
module.exports = (config) => {
/**
* @see https://www.browserstack.com/automate/capabilities
*/
const customLaunchers = {
bs_chrome_mac: {
base: 'BrowserStack',
browser: 'Chrome',
browser_version: '104.0',
os: 'OS X',
os_version: 'Big Sur',
},
bs_safari_mac: {
base: 'BrowserStack',
browser: 'Safari',
browser_version: '15.6',
os: 'OS X',
os_version: 'Monterey',
},
bs_firefox_pc: {
base: 'BrowserStack',
browser: 'Firefox',
browser_version: '102.0',
os: 'Windows',
os_version: '10',
},
bs_edge_pc: {
base: 'BrowserStack',
browser: 'Edge',
browser_version: '108.0',
os: 'Windows',
os_version: '11',
},
};
const globalConfig = getGlobalConfig(config);
config.set({
...globalConfig,
// global config of your BrowserStack account
browserStack: {
username: 'benjaminbrook3',
project: 'Conflux',
video: false,
build: `conflux@${packageJson.version} - ${short()} - ${
process.env.GITHUB_RUN_ID ? `CI: ${process.env.GITHUB_RUN_ID}` : 'Local'
}`,
},
// define browsers
customLaunchers,
browsers: Object.keys(customLaunchers),
reporters: [...globalConfig.reporters, 'BrowserStack'],
plugins: [...globalConfig.plugins, 'karma-browserstack-launcher'],
});
};