-
Notifications
You must be signed in to change notification settings - Fork 290
/
karma.conf.js
99 lines (84 loc) · 2.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
/*jshint node: true*/
var babel = require('rollup-plugin-babel');
var resolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var globals = require('rollup-plugin-node-globals');
var builtins = require('rollup-plugin-node-builtins');
var json = require('rollup-plugin-json');
var string = require('rollup-plugin-string');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon'],
files: [
'https://unpkg.com/leaflet@1.3.4/dist/leaflet.js',
{
pattern : 'test/fixtures/*',
watched : false,
included : false,
served : true
},
{
pattern: 'build/worker.test.js',
watched : false,
included: false,
served: true
},
{
pattern: 'test/**/*.js'
}
],
exclude: ['test/rollup.config.worker.js'], // skip rollup config for building worker
preprocessors: {
'test/**/*.js' : ['rollup']
},
rollupPreprocessor: {
output: {
format: 'umd',
sourcemap: 'inline',
},
treeshake: false, // treeshaking can remove test code we need!
plugins: [
resolve({
browser: true,
preferBuiltins: false
}),
commonjs({
// There hints are required for importing jszip
// See https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-
namedExports: {
'node_modules/process/browser.js': ['nextTick'],
'node_modules/events/events.js': ['EventEmitter']
}
}),
json({
exclude: ['node_modules/**', 'src/**'] // import JSON files
}),
string({
include: ['**/*.glsl'] // inline shader files
}),
babel({
exclude: ['node_modules/**', '*.json']
}),
// These are needed for jszip node-environment compatibility,
// previously provided by browserify
globals(),
builtins()
]
},
plugins: [
'karma-rollup-preprocessor',
'karma-mocha',
'karma-sinon',
'karma-chrome-launcher',
'karma-mocha-reporter'
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: false
});
};