-
Notifications
You must be signed in to change notification settings - Fork 26
/
karma.config.js
67 lines (63 loc) · 1.66 KB
/
karma.config.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
const babel = require('@rollup/plugin-babel');
const tapSpec = require('tap-spec');
const eslint = require('@rollup/plugin-eslint');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const { getBranch } = require('./test/get_git_branch');
const APM_GIT_BRANCH = getBranch();
const APM_SERVER =
process.env.APM_SERVER !== undefined
? `"${process.env.APM_SERVER}"`
: undefined;
module.exports = (config) => {
const configuration = {
autoWatch: false,
browsers: ['Firefox'],
browserConsoleLogOptions: {
level: 'error',
format: '%b %T: %m',
terminal: false,
},
colors: true,
files: [
'node_modules/@elastic/apm-rum/dist/bundles/elastic-apm-rum.umd.min.js',
'build/d3-milestones.css',
'build/tape.js',
{ pattern: 'test/*-test.js', watched: false },
],
frameworks: ['tap'],
logLevel: config.LOG_ERROR,
plugins: [
'karma-rollup-preprocessor',
'karma-tap',
'karma-tap-pretty-reporter',
'karma-firefox-launcher',
],
preprocessors: {
'test/*-test.js': ['rollup'],
},
reporters: ['tap-pretty'],
rollupPreprocessor: {
external: ['tape'],
output: {
intro: `const APM_GIT_BRANCH = "${APM_GIT_BRANCH}";\nconst APM_SERVER = ${APM_SERVER};\n`,
format: 'iife',
globals: {
tape: 'tape',
},
sourcemap: 'inline',
},
plugins: [
eslint({
exclude: ['src/styles/**'],
}),
nodeResolve(),
babel({ babelHelpers: 'bundled' }),
],
},
singleRun: true,
tapReporter: {
prettify: tapSpec,
},
};
config.set(configuration);
};