forked from bleenco/abstruse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
95 lines (91 loc) · 2.57 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
const path = require('path');
function root(p) {
return path.resolve(__dirname, p);
}
module.exports = (config) => {
const webpackConfig = {
devtool: 'inline-source-map',
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: [ root('node_modules/rxjs'), root('node_modules/@angular') ] },
{ test: /\.ts$/, use: [ { loader: 'awesome-typescript-loader', options: { configFileName: root('src/app/tsconfig.spec.json') } }, { loader: 'angular2-template-loader' } ], exclude: [/\.aot\.ts$/] },
{ test: /\.css$/, loader: ['to-string-loader', 'css-loader'] },
{ test: /\.scss$|\.sass$/, loader: ['raw-loader', 'sass-loader'] },
{ test: /\.html$/, loader: 'raw-loader', exclude: [root('src/app/index.html')] }
]
},
performance: { hints: false },
node: {
global: true,
process: false,
crypto: 'empty',
module: false,
clearImmediate: false,
setImmediate: false
}
};
const configuration = {
basePath: '.',
frameworks: ['jasmine'],
client: {
clearContext: false
},
exclude: [],
files: [
{ pattern: './src/app/test.ts', watched: false },
{ pattern: './src/app/assets/**/*', watched: false, included: false, served: true, nocache: false }
],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-webpack'),
require('karma-spec-reporter')
],
preprocessors: { './src/app/test.ts': ['webpack'] },
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
stats: {
errors: true,
errorDetails: true,
depth: false,
chunkOrigins: false,
chunkModules: false,
chunks: false,
children: false,
cacheAssets: false,
cached: false,
assets: false,
modules: false,
hash: false,
reasons: false,
source: false,
timings: true,
version: false,
warnings: false
}
},
reporters: ['spec'],
specReporter: {
maxLogLines: 5,
suppressErrorSummary: false,
suppressFailed: false,
suppressPassed: false,
suppressSkipped: true,
showSpecTiming: true
},
port: 9876,
colors: true,
logLevel: config.LOG_ERROR,
autoWatch: false,
browsers: ['Chrome'],
mime: { 'text/x-typescript': ['ts', 'tsx'] },
singleRun: true,
concurrency: 1,
browserNoActivityTimeout: 10000
};
config.set(configuration);
};