1
|
|
|
// Karma configuration |
2
|
|
|
const path = require( 'path' ); |
3
|
|
|
const src = path.resolve( __dirname, '..', 'src' ); |
|
|
|
|
4
|
|
|
|
5
|
|
|
module.exports = function( config ) { |
6
|
|
|
config.set( { |
7
|
|
|
frameworks: [ 'jasmine', 'es6-shim' ], |
8
|
|
|
reporters: [ 'spec', 'coverage' ], |
9
|
|
|
browsers: [ 'PhantomJS' ], |
10
|
|
|
colors: true, |
11
|
|
|
|
12
|
|
|
// ... normal karma configuration |
13
|
|
|
files: [ |
14
|
|
|
'node_modules/babel-polyfill/dist/polyfill.js', |
15
|
|
|
require.resolve( 'jquery' ), |
16
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js', |
17
|
|
|
'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js', |
18
|
|
|
'node_modules/Iris/dist/iris.min.js', |
19
|
|
|
|
20
|
|
|
// All files ending in "_test" |
21
|
|
|
// { pattern: 'test/*_test.js', watched: false } |
22
|
|
|
|
23
|
|
|
{ pattern: 'test/**/*_test.js', watched: false } |
24
|
|
|
|
25
|
|
|
// Each file acts as entry point for the webpack configuration |
26
|
|
|
], |
27
|
|
|
|
28
|
|
|
preprocessors: { |
29
|
|
|
|
30
|
|
|
// Add webpack as preprocessor |
31
|
|
|
'test/*_test.js': [ 'webpack', 'coverage' ], |
32
|
|
|
'test/**/*_test.js': [ 'webpack', 'coverage' ] |
33
|
|
|
}, |
34
|
|
|
|
35
|
|
|
// optionally, configure the reporter |
36
|
|
|
coverageReporter: { |
37
|
|
|
type: 'html', |
38
|
|
|
dir: 'coverage/', |
39
|
|
|
reporters: [ |
40
|
|
|
|
41
|
|
|
// reporters not supporting the `file` property |
42
|
|
|
{ type: 'html', subdir: 'report-html' }, |
43
|
|
|
{ type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' }, |
44
|
|
|
{ type: 'lcov', subdir: 'report-lcov' } |
45
|
|
|
] |
46
|
|
|
}, |
47
|
|
|
|
48
|
|
|
webpack: require( './config/webpack.test.js' ), |
49
|
|
|
|
50
|
|
|
webpackMiddleware: { |
51
|
|
|
|
52
|
|
|
// Webpack-dev-middleware configuration |
53
|
|
|
// i. e. |
54
|
|
|
stats: 'errors-only' |
55
|
|
|
} |
56
|
|
|
} ); |
57
|
|
|
}; |
58
|
|
|
|