-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.config.js
More file actions
69 lines (60 loc) · 1.6 KB
/
karma.config.js
File metadata and controls
69 lines (60 loc) · 1.6 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
const cwd = process.cwd();
const rollup = require('./rollup.config');
module.exports = config => config.set({
basePath: cwd,
singleRun: true,
frameworks: ['jasmine'],
reporters: ['mocha'],
browsers: [
'ChromeHeadless',
'FirefoxHeadless'
],
files: [
// common files
{ pattern: require.resolve('regenerator-runtime/runtime'), watched: false },
{ pattern: require.resolve('./scripts/test-helpers'), watched: false },
// local package files
{ pattern: 'src/index.js', watched: false },
{ pattern: 'test/helpers.js', watched: false },
{ pattern: 'test/**/*.test.js', watched: false }
],
proxies: {
// useful when the contents of a fake asset do not matter
'/_/': 'localhost/'
},
// create dedicated bundles for src, test helpers, and each test suite
preprocessors: {
'src/index.js': ['rollup'],
'test/helpers.js': ['rollupTestHelpers'],
'test/**/*.test.js': ['rollupTestFiles']
},
client: {
env: {
// used in the test helper to add failed test debug logs
DUMP_FAILED_TEST_LOGS: process.env.DUMP_FAILED_TEST_LOGS
},
// reports look better when not randomized
jasmine: {
random: false
}
},
// (see rollup.config.js)
rollupPreprocessor: rollup.test,
customPreprocessors: {
rollupTestHelpers: {
base: 'rollup',
options: rollup.testHelpers
},
rollupTestFiles: {
base: 'rollup',
options: rollup.testFiles
}
},
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-mocha-reporter',
'karma-rollup-preprocessor'
]
});