forked from jlmakes/scrollreveal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
95 lines (87 loc) · 2.09 KB
/
Copy pathkarma.conf.js
File metadata and controls
95 lines (87 loc) · 2.09 KB
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
const rollupPlugins = [
require('rollup-plugin-json')(),
require('rollup-plugin-node-resolve')({ jsnext: true, main: true }),
require('rollup-plugin-buble')()
]
if (process.env.COVERAGE) {
rollupPlugins.push(
require('rollup-plugin-istanbul')({
exclude: [
'../package.json',
'../src/index.js',
'./**/*.spec.js',
'**/node_modules/**'
],
instrumenterConfig: {
embedSource: true
}
})
)
}
module.exports = function(karma) {
karma.set({
frameworks: ['mocha', 'sinon-chai'],
preprocessors: {
'./**/*.spec.js': ['rollup']
},
files: [{ pattern: './**/*.spec.js', watched: false }],
rollupPreprocessor: {
plugins: rollupPlugins,
output: {
format: 'iife',
name: 'ScrollReveal',
sourcemap: 'inline'
}
},
colors: true,
concurrency: 10,
logLevel: karma.LOG_ERROR,
singleRun: true,
browserDisconnectTolerance: 1,
browserDisconnectTimeout: 60 * 1000,
browserNoActivityTimeout: 60 * 1000,
// browserNoActivityTimeout: 60 * 1000 * 10 * 6, // dev tools debugging
captureTimeout: 4 * 60 * 1000
})
if (process.env.TRAVIS) {
if (process.env.COVERAGE) {
karma.set({
autoWatch: false,
browsers: ['ChromeHeadless'],
coverageReporter: {
type: 'lcovonly',
dir: 'coverage/'
},
reporters: ['mocha', 'coverage', 'coveralls']
})
} else {
const customLaunchers = require('./sauce.conf')
karma.set({
autoWatch: false,
browsers: Object.keys(customLaunchers),
customLaunchers,
reporters: ['dots', 'saucelabs'],
hostname: 'localsauce',
sauceLabs: {
testName: 'ScrollReveal',
build: process.env.TRAVIS_BUILD_NUMBER || 'manual',
tunnelIdentifier: process.env.TRAVIS_BUILD_NUMBER || 'autoGeneratedTunnelID',
recordVideo: true,
connectOptions: {
tunnelDomains: 'localsauce' // because Android 8 has an SSL error?
}
}
})
}
} else {
karma.set({
browsers: ['ChromeHeadless'],
// browsers: ['Chrome'], // dev tools debugging
coverageReporter: {
type: 'lcov',
dir: '../.ignore/coverage/'
},
reporters: ['mocha', 'coverage']
})
}
}