-
Notifications
You must be signed in to change notification settings - Fork 27
/
karma.conf.js
57 lines (51 loc) · 1.28 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
module.exports = function setKarmaConfig(config) {
config.set({
basePath: '',
frameworks: ['browserify', 'mocha', 'sinon'],
files: [
// Source
// 'src/js/**/*.js',
// // Application
// 'public/stylesheets/main.css',
// 'public/index.html',
// Test suites
'test/**/*.js',
'test/**/*.jsx',
],
exclude: [],
preprocessors: {
'test/**/*.{js,jsx}': ['browserify'],
},
browserify: {
debug: true,
extensions: ['.jsx'],
transform: [
['babelify', { presets: ['es2015', 'react'] }],
'brfs',
],
// Configuration required for enzyme to work; see
// http://airbnb.io/enzyme/docs/guides/browserify.html
configure(bundle) {
bundle.on('prebundle', () => {
bundle.external('react/addons');
bundle.external('react/lib/ReactContext');
bundle.external('react/lib/ExecutionEnvironment');
});
},
},
plugins: [
'karma-mocha',
'karma-sinon',
'karma-phantomjs-launcher',
'karma-mocha-reporter',
'karma-browserify',
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['PhantomJS'],
singleRun: true,
});
};