-
Notifications
You must be signed in to change notification settings - Fork 29
/
karma-ci.conf.js
102 lines (93 loc) · 3.09 KB
/
karma-ci.conf.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
// Browsers to run on Sauce Labs
const customLaunchers = {
SL_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest',
},
SL_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest',
},
SL_safari: {
base: 'SauceLabs',
browserName: 'safari',
version: 'latest',
},
// SL_ie_11: {
// base: 'SauceLabs',
// browserName: 'internet explorer',
// browserVersion: '11.285',
// platformName: 'Windows 10',
// },
};
module.exports = (config) => {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
process.exit(1);
}
config.set({
// list of files / patterns to load in the browser
files: [
// polyfill
// {pattern: 'node_modules/@webreflection/custom-elements-no-builtin/min.js', served: true, nocache: true },
// modules
{pattern: 'dist/js/joomla-alert.js', type: 'module' },
// {pattern: 'dist/js/joomla-collapse.js', type: 'module' },
// {pattern: 'dist/js/joomla-dropdown.js', type: 'module' },
// {pattern: 'dist/js/joomla-modal.js', type: 'module' },
{pattern: 'dist/js/joomla-tab.js', type: 'module' },
// {pattern: 'dist/js//joomla-tip.js', type: 'module' },
// ES5
// {pattern: 'dist/js/joomla-alert-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-collapse-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-dropdown-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-modal-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-panels-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-tab-es5.js', nomodule: '' },
// {pattern: 'dist/js/joomla-tip-es5.js', nomodule: '' },
// CSS
'dist/css/joomla-alert.css',
'dist/css/joomla-tab.css',
{ pattern: './tests/**/*.js' },
{ pattern: './tests/**/*.html' },
],
preprocessors: {
// 'packags/src/**/js/*.js': ['coverage'],
'tests/**/*.html': ['html2js'],
},
plugins: [
'karma-sauce-launcher',
'karma-jasmine',
'karma-fixture',
'karma-html2js-preprocessor',
],
// frameworks to use
frameworks: ['jasmine', 'fixture'],
// SauceLabs Configuration
sauceLabs: {
testName: 'Web App Unit Tests',
build: `GITHUB #${process.env.GITHUB_RUN_ID} (${process.env.GITHUB_RUN_NUMBER})`,
startConnect: false,
tunnelIdentifier: `github-action-tunnel-custom-elements-${process.env.GITHUB_RUN_ID}`,
},
reporters: ['dots', 'saucelabs'],
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: process.cwd(),
runnerPort: 9100,
colors: true,
port: 9876,
autoWatch: false,
logLevel: config.LOG_INFO,
singleRun: true,
concurrency: 1,
captureTimeout: 120000,
browserNoActivityTimeout: 60000,
browserDisconnectTimeout: 20000,
browserDisconnectTolerance: 1,
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
});
};