forked from subschema/subschema
-
Notifications
You must be signed in to change notification settings - Fork 4
/
karma.conf.js
76 lines (69 loc) · 2.31 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
var webpack = require('webpack'), path = require('path'), join = path.join.bind(path, __dirname);
;
module.exports = function (config) {
config.set({
browserNoActivityTimeout: 20000,
browsers: ['Chrome'], //run in Chrome
singleRun: true, //just run once by default
frameworks: ['mocha'], //use the mocha test framework
files: [
'test/index.js' //just load this file
],
preprocessors: {
'test/*': ['webpack', 'sourcemap'] //preprocess with webpack and our sourcemap loader
},
reporters: ['dots'], //report results in this format
webpack: { //kind of a copy of your webpack config
cache: true,
debug: true,
devtool: 'inline-source-map',
stats: {
colors: true,
reasons: true
},
module: {
loaders: [
{
test: /\.js(x)?$/,
exclude: /node_modules/,
include: [
join('src'),
join('test'),
join('public')
],
loader: 'babel-loader?stage=0'
},
{
test: /-setup\.js(x)?$/,
loader: join('test/support/sample-loader.js')
},
{
test: /\.less$/,
loader: 'style!css!less-loader'
},
{
test: /\.json$/,
loader: 'json'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'subschema': join('src/index.jsx'),
'subschema-styles': join('src/styles'),
'Subschema': join('src/index.jsx'),
}
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})]
},
webpackMiddleware: {
stats: {
colors: true
}
}
});
};