forked from auth0/lock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
123 lines (105 loc) · 2.8 KB
/
karma.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = function (config) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
frameworks: ['mocha', 'browserify'],
//plugins
plugins: [
'karma-mocha',
'karma-babel-preprocessor',
'karma-browserstack-launcher',
'karma-chrome-launcher',
'karma-browserify',
'karma-mocha-reporter'
],
// list of files / patterns to load in the browser
files: [
'test/**/*.test.js',
'test/setup.js',
{
pattern: 'src/!(__tests__)/**/*.jsx?',
type: 'js'
}
],
preprocessors: {
'src/!(__tests__)/**/*.jsx?': ['browserify'],
'test/**/*.js': ['browserify']
},
browserify: {
debug: true,
transform: ['babelify'],
extensions: ['.js', '.jsx']
},
// test results reporter to use
reporters: ['mocha', 'BrowserStack'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
singleRun: true,
browserNoActivityTimeout: 60000,
browserDisconnectTimeout: 30000,
browserDisconnectTolerance: 10,
// level of logging
logLevel: config.LOG_INFO,
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
name: 'Lock.js Browser Tests',
project: 'Lock.js SDK'
},
mochaReporter: {
output: 'minimal'
},
// define browsers
customLaunchers: {
bs_chrome_windows: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
displayName: 'Chrome on Windows 10'
},
bs_edge_windows: {
base: 'BrowserStack',
browser: 'edge',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
displayName: 'Chrome on Windows 10'
},
bs_firefox_windows: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
displayName: 'Firefox on Windows 10'
},
bs_safari: {
base: 'BrowserStack',
browser: 'safari',
browser_version: 'latest',
os: 'OS X',
os_version: 'Big Sur',
displayName: 'Latest Safari on Big Sur'
},
bs_ie11_windows: {
base: 'BrowserStack',
browser: 'IE',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
displayName: 'IE11 on Windows 10'
},
chrome_headless: {
base: 'Chrome',
flags: ['--headless']
}
},
browsers: ['bs_chrome_windows']
});
};