forked from getguesstimate/guesstimate-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
82 lines (81 loc) · 2.09 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
var customConfig = require('./customConfig')
module.exports = function (config) {
config.set({
browsers: [ 'Chrome' ],
// karma only needs to know about the test bundle
files: [
'node_modules/babel-core/browser-polyfill.js',
{
pattern: 'tests.bundle.js',
watched: true
}
],
frameworks: [ 'chai', 'mocha' ],
plugins: [
'karma-chrome-launcher',
'karma-chai',
'karma-mocha',
'karma-sourcemap-loader',
'karma-webpack',
],
// run the bundle through the webpack and sourcemap plugins
preprocessors: {
'tests.bundle.js': [ 'webpack', 'sourcemap' ]
},
reporters: [ 'dots' ],
usePolling: true,
singleRun: false,
// webpack config object
webpack: { //kind of a copy of your webpack config
devtool: 'inline-source-map', //just do inline source maps instead of the default
plugins: customConfig.plugins,
module: {
loaders: [
{
test: /(\.js$)|(\.jsx$)/,
exclude: /node_modules/,
loaders: [
'babel-loader'
]
},
{
test: /\.json$/,
loaders: ['json']
},
{
test: /\.(otf|eot|svg|ttf|woff)/,
loader: 'url-loader?limit=10000',
},
{
test: /\.(jpe?g|png|gif)/,
loader: 'url-loader?limit=10000',
},
{
test: /\.ejs$/,
loader: 'ejs-compiled-loader'
},
{
test: /node_modules\/auth0-lock\/.*\.js$/,
loaders: ['transform/cacheable?brfs', 'transform/cacheable?packageify']
},
{
test: /\.css$/,
loader: 'null-loader',
},
],
},
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
resolve: customConfig.resolutions,
},
colors: true,
autoWatch: true,
webpackMiddleware: {
noInfo: true,
}
});
};