forked from TypeStrong/ts-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
61 lines (47 loc) · 1.36 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
/* eslint-disable no-var, strict */
'use strict';
var webpackConfig = require('./webpack.config.base.js');
module.exports = function (config) {
var plugins = [].concat(webpackConfig.plugins);
// https://github.com/webpack-contrib/karma-webpack/issues/24#issuecomment-257613167
var commonsChunkPluginIndex = plugins.findIndex(plugin => plugin.chunkNames);
plugins.splice(commonsChunkPluginIndex, 1);
// Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html
config.set({
browsers: ['PhantomJS'],
files: [
// This ensures we have the es6 shims in place and then loads all the tests
'test/main.js'
],
port: 9876,
frameworks: ['jasmine'],
logLevel: config.LOG_INFO, //config.LOG_DEBUG
preprocessors: {
'test/main.js': ['webpack', 'sourcemap']
},
webpack: {
devtool: 'inline-source-map',
module: webpackConfig.module,
resolve: webpackConfig.resolve,
plugins: plugins
},
webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},
// reporter options
mochaReporter: {
colors: {
success: 'bgGreen',
info: 'cyan',
warning: 'bgBlue',
error: 'bgRed'
}
},
notifyReporter: {
reportSuccess: false // Default: true, Will notify when a suite was successful
}
});
};