This repository has been archived by the owner on Apr 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
96 lines (81 loc) · 2.54 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
83
84
85
86
87
88
89
90
91
92
93
94
95
// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html
module.exports = function karmaConfig(config) {
config.set({
// base path that will be used to resolve all patterns (e.g. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [
'mocha',
'chai',
'sinon'
],
client: {
args: ['--grep', config.grep || '']
},
// list of files to exclude
exclude: [],
reporters: [
// Reference: https://github.com/mlex/karma-spec-reporter
// Set reporter to print detailed results to console
'spec',
// Reference: https://github.com/karma-runner/karma-coverage
// Output code coverage files
'coverage'
],
// list of files / patterns to load in the browser
// we are building the test environment in ./spec-bundle.js
files: [{pattern: 'spec-bundle.js', watched: false}],
preprocessors: {
// Reference: http://webpack.github.io/docs/testing.html
// Reference: https://github.com/webpack/karma-webpack
// Convert files with webpack and load sourcemaps
'spec-bundle.js': ['webpack', 'sourcemap']
},
browsers: [
// Run tests using PhantomJS
'PhantomJS'
],
autoWatch: true,
singleRun: true,
// Configure code coverage reporter
coverageReporter: {
dir: 'build/coverage/',
type: 'html'
},
webpack: require('./webpack.test'),
webpackMiddleware: {
noInfo: true,
stats: {
// With console colors
colors: true,
// add the hash of the compilation
hash: true,
// add webpack version information
version: false,
// add timing information
timings: true,
// add assets information
assets: true,
// add chunk information
chunks: true,
// add built modules information to chunk information
chunkModules: false,
// add built modules information
modules: false,
// add also information about cached (not built) modules
cached: true,
// add information about the reasons why modules are included
reasons: false,
// add the source code of modules
source: true,
// add details to errors (like resolving log)
errorDetails: true,
// add the origins of chunks and chunk merging info
chunkOrigins: true,
// Add messages from child loaders
children: false
}
}
});
};