forked from NuCivic/react-dash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.config.js
52 lines (49 loc) · 1.7 KB
/
karma.config.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
var webpack = require('karma-webpack');
module.exports = function (config) {
config.set({
frameworks: [ 'jasmine' ],
files: [
// polyfills
'./node_modules/babel-polyfill/dist/polyfill.js',
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'./node_modules/fetch-polyfill/fetch.js',
// tests
'tests/**/*_spec.js',
// fixtures
{ pattern:'tests/fixtures/*.js', watched: true, served: true, included: false },
{ pattern: 'tests/fixtures/*.json', watched: true, served: true, included: false },
{ pattern: 'tests/fixtures/*.geojson', watched: true, served: true, included: false }
],
plugins: [webpack, 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage', 'karma-spec-reporter'],
browsers: [ 'PhantomJS' ],
preprocessors: {
'tests/**/*_spec.js': ['webpack'],
'src/**/*.js': ['webpack']
},
reporters: [ 'spec', 'coverage' ],
coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'lcov', subdir: 'report-lcov' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' }
]
},
webpack: {
module: {
loaders: [
{
test: /\.(js|jsx)$/, exclude: /(bower_components|node_modules)/,
loader: 'babel-loader',
query: {compact: false}
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.json$/, loader: "json-loader" },
{ test: /\.geojson$/, loader: "json-loader" },
{ test: /\.scss$/, loaders: ['style', 'css', 'sass'] }
]
}
},
webpackMiddleware: { noInfo: true }
});
};