-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
56 lines (51 loc) · 1.45 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
var webpackConfig = require('./webpack.config.js');
module.exports = function (config) {
const configuration = {
// Find all files that match this glob
files: ['**/*.spec.ts'],
// Before running any tests, run them through webpack
preprocessors: {
"**/*.spec.ts": ['webpack']
},
// Use the following webpack configuration (pulled from webpack.config.js)
// webpack.entry will be set to the file currently being preprocessed
webpack: {
mode: webpackConfig.mode,
devtool: webpackConfig.devtool,
resolve: webpackConfig.resolve,
module: webpackConfig.module
},
// Allows karma to read ts files
mime: {
"text/x-typescript": ['ts', 'tsx']
},
browsers: ['Chrome'],
reporters: ['progress', 'kjhtml'],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
basePath: '',
frameworks: ['jasmine'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: false,
concurrency: Infinity
};
if (process.env.TRAVIS) {
// Travis CI Chrome needs to run without sandbox
configuration.customLaunchers = {
ChromeTravis: {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
configuration.browsers = ['ChromeTravis'];
}
config.set(configuration);
};