-
Notifications
You must be signed in to change notification settings - Fork 234
/
karma.conf.js
56 lines (54 loc) · 1.34 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
const path = require('path');
function configureKarma(config) {
config.set({
basePath: __dirname,
browsers: ['PhantomJS'],
coverageReporter: {
reporters: [
{ type: 'html' },
{ type: 'text' },
],
},
frameworks: ['jasmine'],
files: ['test/index.js'],
preprocessors: {
'src/index.js': ['coverage'],
'test/index.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: {
devtool: 'inline-source-map',
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
module: {
rules: [
{
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test'),
],
loader: 'babel-loader',
query: {
plugins: ['istanbul'],
},
test: /\.jsx?$/,
},
{
include: path.resolve(__dirname, 'src'),
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
test: /\.scss$/,
},
],
},
resolve: {
modules: ['node_modules'],
extensions: ['.js', '.jsx'],
},
},
});
}
module.exports = configureKarma;