forked from react-dates/react-dates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
101 lines (86 loc) · 2.17 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* eslint no-param-reassign:0, import/no-extraneous-dependencies:0 */
const path = require('path');
const webpack = require('webpack');
module.exports = (config) => {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon', 'chai'],
files: [
'test/_helpers/restoreSinonStubs.js',
'test/utils/*',
'test/components/*',
],
webpack: {
externals: {
sinon: true,
},
plugins: [
// https://github.com/cheeriojs/cheerio/issues/836
new webpack.NormalModuleReplacementPlugin(/^\.\/package$/, (result) => {
if (/cheerio/.test(result.context)) {
result.request = './package.json';
}
}),
],
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: [
path.join(__dirname, 'src'),
path.join(__dirname, 'test'),
require.resolve('airbnb-js-shims'),
],
query: {
presets: ['airbnb'],
},
},
{
test: /\.svg$/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['airbnb'],
},
},
{
loader: 'react-svg-loader',
query: {
jsx: true,
},
},
],
include: [
path.join(__dirname, 'src'),
],
},
{ test: /\.json$/, loader: 'json-loader' },
// Inject the Airbnb shims into the bundle
{ test: /test\/_helpers/, loader: 'imports-loader?shims=airbnb-js-shims' },
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
},
webpackMiddleware: {
progress: false,
stats: false,
debug: false,
quiet: true,
},
preprocessors: {
'test/**/*': ['webpack'],
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Firefox'],
singleRun: true,
concurrency: Infinity,
});
};