-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathkarma.conf.cjs
More file actions
85 lines (74 loc) · 1.97 KB
/
karma.conf.cjs
File metadata and controls
85 lines (74 loc) · 1.97 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
'use strict';
/* eslint-env node */
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve').nodeResolve;
const babel = require('@rollup/plugin-babel');
const webWorkerLoader = require('@pyrologic/rollup-plugin-web-worker-loader');
const path = require('path');
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai-sinon'],
client: {
chai: {
includeStack: true
},
mocha: {
timeout: 10000
}
},
files: [
{ pattern: 'test/data/4channel.wav', included: false, served: true },
{ pattern: 'test/unit/tests-browser.js', type: 'module', included: true }
],
preprocessors: {
'test/unit/tests-browser.js': ['rollup']
},
rollupPreprocessor: {
plugins: [
commonjs(),
resolve({ browser: true }),
webWorkerLoader(),
babel.babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
plugins: ['istanbul']
})
],
output: {
format: 'iife',
name: 'WaveformData',
sourcemap: 'inline'
},
onwarn: function(warning) {
if (warning.code === 'CIRCULAR_DEPENDENCY' &&
warning.message.indexOf(path.normalize('node_modules/chai/lib') === 0)) {
// Chai contains circular references, but they are not fatal and can be ignored.
return;
}
}
},
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless']
}
},
reporters: ['spec', 'coverage'],
coverageReporter: {
reporters: [
{ type: 'html', dir: 'coverage', subdir: '.' },
{ type: 'text' },
{ type: 'text-summary' }
]
},
port: 8080,
runnerPort: 9100,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeHeadless'],
captureTimeout: 30000,
singleRun: true
});
};