forked from olivaframework/olivajs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
75 lines (71 loc) · 1.61 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
var ENV = process.env.npm_lifecycle_event;
var isCoverage = ENV === 'coverage';
var isPublish = ENV === 'prepare';
var reporters = ['progress'];
if (isCoverage) {
reporters.push('coverage');
}
var webpackConfig = require('./webpack.config.js');
webpackConfig.module.loaders.push({
enforce: 'post',
test: /\.ts$/,
loader: 'istanbul-instrumenter-loader'
});
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai', 'sinon', 'source-map-support'],
files: [{
pattern: 'tests/*.spec.js',
watched: false
}],
exclude: [
],
preprocessors: {
'src/scripts/*.ts': ['webpack'],
'tests/*.js': ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
quiet: false,
noInfo: true,
reporter: null,
stats: {
chunks: false,
colors: true,
cached: false
}
},
reporters: reporters,
coverageReporter: {
type: 'json',
dir: 'tests/coverage',
subdir: '.'
},
port: 9876,
colors: true,
logLevel: config.LOG_DISABLE,
autoWatch: !isCoverage,
autoWatchBatchDelay: 100,
browsers: ['PhantomJS_custom'],
customLaunchers: {
'PhantomJS_custom': {
base: 'PhantomJS',
options: {
windowName: 'my-window',
settings: {
webSecurityEnabled: false
},
viewportSize: {
width: 500,
height: 500
}
},
flags: ['--load-images=true'],
debug: true
}
},
singleRun: isCoverage || isPublish,
concurrency: Infinity
})
}