forked from meganz/webclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
executable file
·300 lines (269 loc) · 8.81 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
// Karma configuration.
module.exports = function(config) {
var specific_tests = process.env.SPECIFIC_TEST || 'test/**/*_test.js';
config.set({
// Base path, that will be used to resolve files and exclude.
basePath: '',
// Frameworks to use.
frameworks: ['mocha', 'chai', 'sinon'],
// List of files/patterns to load in the browser.
// {included: false} files are loaded by requirejs
files: [
// == Basic test setup ==
'test/test_main.js',
'test/test_utils.js',
// == Basics ==
'js/vendor/jquery.js',
'js/vendor/jquery-ui.js',
'js/jquery.misc.js',
// == Libraries ==
'js/vendor/asmcrypto.js',
'js/vendor/nacl-fast.js',
'js/vendor/moment.js',
'js/vendor/autolinker.js',
// == Test helpers and test configuration ==
'test/lang_dummy.js',
'test/config.js',
// Shim for ES6 features some browsers may not have (PhantomJS, MSIE).
'js/vendor/web-streams-polyfill.js',
'js/vendor/dexie.js',
// == Our code ==
'secureboot.js',
'index.js',
'nodedec.js',
'js/vendor/megaLogger.js',
'js/utils/broadcast.js',
'js/utils/polyfills.js',
'js/utils/api.js',
'js/utils/browser.js',
'js/utils/debug.js',
'js/utils/conv.js',
'js/utils/crypt.js',
'js/utils/dom.js',
'js/utils/events.js',
'js/utils/locale.js',
'js/utils/media.js',
'js/utils/network.js',
'js/utils/timers.js',
'js/utils/watchdog.js',
'js/utils/webgl.js',
'js/utils/workers.js',
'js/functions.js',
'js/datastructs.js',
'js/mega.js',
'js/fm.js',
'js/fm/account.js',
'js/fm/filemanager.js',
'js/fm/achievements.js',
'js/fm/dashboard.js',
'js/fm/removenode.js',
'js/fm/ufssizecache.js',
'js/fm/utils.js',
'js/fm/megadata.js',
'js/fm/megadata/account.js',
'js/fm/megadata/contacts.js',
'js/fm/megadata/filters.js',
'js/fm/megadata/menus.js',
'js/fm/megadata/nodes.js',
'js/fm/megadata/openfolder.js',
'js/fm/megadata/render.js',
'js/fm/megadata/render-breadcrumbs.js',
'js/fm/megadata/reset.js',
'js/fm/megadata/sort.js',
'js/fm/megadata/transfers.js',
'js/fm/megadata/tree.js',
'js/tlvstore.js',
'js/crypto.js',
'js/megaPromise.js',
'js/idbkvstorage.js',
'sjcl.js',
'js/mDB.js',
'js/sharedlocalkvstorage.js',
'js/paycrypt.js',
'js/attr.js',
'js/account.js',
'js/authring.js',
'js/mouse.js',
'js/filedrag.js',
'js/thumbnail.js',
'js/vendor/exif.js',
'js/vendor/tiff.js',
'js/vendor/dcraw.js',
'js/vendor/smartcrop.js',
'js/filetypes.js',
'js/ui/miniui.js',
'js/ui/export.js',
'js/ui/dialog.js',
'js/ui/toast.js',
'js/ui/feedbackDialog.js',
'js/ui/credentialsWarningDialog.js',
'js/ui/loginRequiredDialog.js',
'js/config.js',
'js/notify.js',
'js/megaNotifications.js',
'js/vendor/avatar.js',
'js/keymgr.js',
'js/keepAlive.js',
'js/metatags.js',
'js/utils/trans.js',
'js/ui/megaInputs.js',
'js/ui/megaInputs-underlinedText.js',
'js/ui/dropdowns.js',
'js/time_checker.js',
// Transfers
'js/transfers/meths/filesystem.js',
'js/transfers/meths/memory.js',
'js/transfers/meths/cache.js',
'js/transfers/utils.js',
'js/transfers/queue.js',
'js/transfers/downloader.js',
'js/transfers/download2.js',
'js/transfers/reader.js',
'js/transfers/upload2.js',
'js/transfers/zip64.js',
'js/transfers/meths.js',
{pattern: 'aesasm.js', included: false},
{pattern: 'encrypter.js', included: false},
// Our chat code.
'js/chat/strongvelope.js',
'js/fm/linkinfohelper.js',
'js/chat/plugins/urlFilter.js',
'js/chat/plugins/emoticonShortcutsFilter.js',
'js/chat/plugins/emoticonsFilter.js',
'js/chat/plugins/backtickRtfFilter.js',
'js/chat/plugins/rtfFilter.js',
'js/chat/plugins/chatNotifications.js',
'js/chat/plugins/callFeedback.js',
'js/chat/plugins/geoLocationLinks.js',
'js/chat/messages.js',
'js/utils/emoji.js',
// == Test utilities ==
'test/utilities/fakebroadcaster.js',
'test/utilities/promises.js',
// == Tests ==
// Dependency-based load order of library modules.
// modules that already follow AMD need included: false
(process.env.SKIP_WORKFLOWS)
? 'test/config/test_workflows_off.js'
: 'test/config/test_workflows.js',
specific_tests
],
// List of files to exclude.
exclude: [
],
// Fix up to make it work on the Jenkins server.
urlRoot: '/base',
proxies: {
'/': './'
},
// Test results reporter to use.
// Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'.
reporters: ['progress', 'coverage', 'junit'],
// Source files to generate a coverage report for.
// (Do not include tests or libraries.
// These files will be instrumented by Istanbul.)
preprocessors: {
'*.js': ['coverage'],
'js/*.js': ['coverage'],
'js/ui/*.js': ['coverage'],
'js/utils/*.js': ['coverage'],
'js/fm/**/*.js': ['coverage'],
'js/transfers/**/*.js': ['coverage'],
'html/js/*.js': ['coverage'],
'js/chat/**/!(bundle)*.js': ['coverage']
},
// Coverage configuration
coverageReporter: {
type: 'html',
dir: 'coverage/',
subdir: function(browser) {
return String(browser).replace(/[^\w.()]+/g, '_');
}
},
// JUnit reporter configuration.
junitReporter: {
outputDir: 'coverage/',
outputFile: 'test-results.xml'
},
// Web server port.
port: 9876,
// Enable/disable colours in the output (reporters and logs).
colors: true,
// Level of logging.
// Possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG.
logLevel: config.LOG_INFO,
// Enable/disable watching file and executing tests whenever any file changes.
autoWatch: true,
client: {
mocha: {
// Increase default timeout of 2000ms
timeout: 4000
}
},
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - ChromeHeadless
// - Firefox
// - FirefoxHeadless (Requires version 55+)
// - FirefoxNightlyHeadless
// - FirefoxDeveloperHeadless
// - Opera (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
browsers: [
// 'Firefox',
// 'FirefoxHeadless',
// 'Firefox_Extension',
// 'Firefox_NoCookies',
// 'Firefox_Incognito',
// 'Chrome',
'ChromeHeadless',
// 'Chrome_Incognito',
// 'Chrome_Unlimited',
// 'Chrome_NoCookies'
],
customLaunchers: {
'Firefox_NoCookies': {
base: 'FirefoxHeadless',
displayName: 'Firefox Headless (NoCookies)',
prefs: {
'network.cookie.cookieBehavior': 2
}
},
'Firefox_Incognito': {
base: 'FirefoxHeadless',
displayName: 'Firefox Headless (PBM)',
flags: ['-private']
},
'Chrome_NoCookies': {
base: 'ChromeHeadless',
displayName: 'Chrome Headless (NoCookies)',
flags: ['--disable-local-storage', '--disable-databases', '--site-per-process']
},
'Chrome_Mobile': {
base: 'Chrome_NoCookies',
displayName: 'Chrome HeadLess (Mobile)',
flags: ['--use-mobile-user-agent', '--webview-sandboxed-renderer'],
},
'Chrome_Incognito': {
base: 'ChromeHeadless',
displayName: 'Chrome Headless (Incognito)',
flags: ['--incognito']
},
'Chrome_Unlimited': {
base: 'ChromeHeadless',
flags: ['--unlimited-storage']
},
'Firefox_Extension': {
base: (process.env.FXEXTBASE || 'FirefoxDeveloper'),
prefs: {
'xpinstall.signatures.required': false
},
extensions: [process.env.FXEXTFILE || '/fxextest@mega.co.nz.xpi']
}
},
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 120000,
browserNoActivityTimeout: 120000
});
};