-
Notifications
You must be signed in to change notification settings - Fork 290
/
karma.conf.js
90 lines (77 loc) · 2.48 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
import babel from '@rollup/plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import globals from 'rollup-plugin-node-globals';
import builtins from 'rollup-plugin-node-builtins';
import json from '@rollup/plugin-json';
import { importAsString } from 'rollup-plugin-string-import';
export default {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon'],
files: [
'https://unpkg.com/[email protected]/dist/leaflet.js', // TODO: update leaflet version
{
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(),
json({
exclude: ['node_modules/**', 'src/**'] // import JSON files
}),
importAsString({
include: ['**/*.glsl'] // inline shader files
}),
babel({
exclude: ['node_modules/**', '*.json'],
babelHelpers: "runtime"
}),
// 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
});
}