forked from vaadin/vaadin-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-test-runner.config.js
79 lines (70 loc) · 1.75 KB
/
web-test-runner.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
/* eslint-env node */
const { createSauceLabsLauncher } = require('@web/test-runner-saucelabs');
const fs = require('fs');
const config = {
nodeResolve: true,
browserStartTimeout: 60000, // default 30000
testsStartTimeout: 60000, // default 10000
testsFinishTimeout: 60000, // default 20000
testFramework: {
config: {
timeout: '10000' // default 2000
}
},
coverageConfig: {
include: ['**/src/*'],
threshold: {
statements: 97,
branches: 58,
functions: 96,
lines: 97
}
}
};
const env = process.env.TEST_ENV;
const sauce = {
firefox: {
browserName: 'firefox',
platform: 'Windows 10',
browserVersion: 'latest'
},
safari: {
browserName: 'safari',
platform: 'macOS 10.15',
browserVersion: 'latest'
}
};
if (env === 'firefox' || env === 'safari') {
// Exclude some tests to reduce Safari flakiness
const exclude = [
'all-imports.test.js',
'extension.test.js',
'hidden-grid.test.js',
'iron-list.test.js',
'missing-imports.test.js',
'resizing-material.test.js'
];
const tests = fs
.readdirSync('./test/')
.filter((file) => file.includes('test.js') && !exclude.includes(file))
.map((file) => `test/${file}`);
const sauceLabsLauncher = createSauceLabsLauncher({
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY
});
const sharedCapabilities = {
'sauce:options': {
name: 'vaadin-grid unit tests',
build: `${process.env.GITHUB_REF || 'local'} build ${process.env.GITHUB_RUN_NUMBER || ''}`
}
};
config.files = tests;
config.concurrency = env === 'firefox' ? 2 : 1;
config.browsers = [
sauceLabsLauncher({
...sharedCapabilities,
...sauce[env]
})
];
}
module.exports = config;