-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
73 lines (72 loc) · 2.39 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
// karma.conf.js
var webpack = require('webpack');
module.exports = function (config) {
// e.g. https://github.com/lelandrichardson/enzyme-example-karma-webpack/blob/master/karma.conf.js
config.set({
browsers: ['PhantomJS'],
hostname: process.env.IP,
port: process.env.PORT,
runnerPort: 0,
// list of files / patterns to load in the browser
files: [
'system/angle/vendor/modernizr/modernizr.custom.js',
'system/angle/vendor/matchMedia/matchMedia.js',
'system/angle/vendor/jquery/dist/jquery.js',
'system/angle/vendor/bootstrap/dist/js/bootstrap.js',
'system/angle/vendor/jQuery-Storage-API/jquery.storageapi.js',
'system/angle/vendor/jquery.easing/js/jquery.easing.js',
'system/angle/vendor/animo.js/animo.js',
'system/angle/vendor/slimScroll/jquery.slimscroll.min.js',
'system/angle/vendor/screenfull/dist/screenfull.js',
'system/angle/vendor/moment/min/moment-with-locales.min.js',
'system/angle/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'system/angle/vendor/datatables/media/js/jquery.dataTables.min.js',
'system/angle/vendor/datatables-colvis/js/dataTables.colVis.js',
'system/angle/vendor/datatables/media/js/dataTables.bootstrap.js',
'system/angle/vendor/sweetalert/dist/sweetalert.min.js',
'system/angle/app/js/app.js',
'tests.bundle.js'
],
frameworks: ['mocha', 'chai', 'sinon'],
plugins: [
'karma-phantomjs-launcher',
'karma-webpack',
'karma-sourcemap-loader',
'karma-mocha',
'karma-chai',
'karma-sinon'
],
// run the bundle through the webpack and sourcemap plugins
preprocessors: {
'tests.bundle.js': ['webpack', 'sourcemap']
},
reporters: ['dots'],
// webpack config object
webpack: {
devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel'
},
{
test: /\.json$/,
loader: 'json',
},
]
},
watch: true,
// https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md
externals: {
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
},
webpackServer: {
noInfo: true
}
});
};