forked from snabbdom/snabbdom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
64 lines (60 loc) · 1.39 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
const ci = !!process.env.CI;
const watch = !!process.env.WATCH;
const live = !!process.env.LIVE;
const ip = 'bs-local.com';
const browserstack = require('./browserstack-karma.js');
const browsers = ci
? Object.keys(browserstack)
: live
? undefined
: watch
? ['Chrome']
: ['Chrome', 'Firefox'];
module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['mocha'],
// list of files / patterns to load in the browser
files: [
{ pattern: 'test/**/*.js' },
{ pattern: 'es/test/**/*.js' }
],
plugins: [
'karma-mocha',
require('karma-mocha-reporter'),
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-browserstack-launcher',
require('karma-webpack')
],
hostname: ci ? ip : 'localhost',
preprocessors: {
'**/*.js': ['webpack']
},
webpack: {
mode: 'development'
},
webpackMiddleware: {
stats: 'errors-only'
},
browserStack: {
name: 'Snabbdom',
retryLimit: 3,
},
client: {
captureConsole: true,
},
browserNoActivityTimeout: 1000000,
customLaunchers: browserstack,
reporters: ['mocha', 'BrowserStack'],
mochaReporter: {
showDiff: true
},
port: 9876,
colors: true,
autoWatch: true,
browsers: browsers,
singleRun: !watch && !live,
concurrency: ci ? 1 : Infinity,
});
};