forked from shaungrady/angular-http-etag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
59 lines (52 loc) · 1.52 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
const path = require('path')
// Determine which version of Angular we're running the tests for. (--ng 1.6)
// If none is specified, default to running tests for Angular 1.6.
const args = process.argv.slice(2)
let index = args.indexOf('--ng')
const ngVersion = index > -1 ? args[index + 1] : '1.6'
const ngConfig = require(`./karma.config.angular-${ngVersion}.js`)
console.log('Karma: Running tests for Angular', ngVersion)
// Config
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: ngConfig.files,
exclude: [],
preprocessors: {
'src/index.js': ['webpack', 'sourcemap'],
'test/**/index.js': ['webpack', 'sourcemap']
},
webpack: {
externals: {
angular: 'angular'
},
module: {
rules: [{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
exclude: /node_modules/,
enforce: 'post',
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true
}
}]
},
devtool: 'inline-source-map'
},
webpackMiddleware: {
stats: 'minimal'
},
reporters: ['progress', 'coverage'],
coverageReporter: ngConfig.coverageReporter,
port: 9876,
colors: true,
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: true,
concurrency: Infinity
})
}