forked from rangle/angular2-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkarma.conf.js
More file actions
69 lines (61 loc) · 1.43 KB
/
karma.conf.js
File metadata and controls
69 lines (61 loc) · 1.43 KB
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
'use strict';
const loaders = require('./webpack/loaders');
module.exports = (config) => {
config.set({
frameworks: [
'mocha',
'chai',
'sinon',
'source-map-support',
],
files: ['./src/tests.entry.ts'],
preprocessors: {
'./src/**/*.ts': [
'webpack',
'sourcemap',
],
'./src/**/!(*.test|tests.*).ts': [
'coverage',
],
},
webpack: {
entry: './src/tests.entry.ts',
devtool: 'source-map',
verbose: true,
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
},
module: {
loaders: [
loaders.tsTest,
],
postLoaders: [
loaders.istanbulInstrumenter,
],
},
stats: { colors: true, reasons: true },
debug: true,
},
webpackServer: {
noInfo: true, // prevent console spamming when running in Karma!
},
reporters: ['mocha', 'coverage'],
// only output json report to be remapped by remap-istanbul
coverageReporter: {
reporters: [
{ type: 'json' },
],
dir: './coverage/',
subdir: (browser) => {
return browser.toLowerCase().split(/[ /-]/)[0]; // returns 'chrome'
},
},
port: 9999,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'], // Alternatively: 'PhantomJS'
captureTimeout: 6000,
singleRun: true,
});
};