This repository was archived by the owner on Nov 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathkarma.conf.js
81 lines (81 loc) · 1.76 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
'use strict'
const path = require('path');
const isTravis = !!process.env.TRAVIS
module.exports = function (config) {
let sourcePath = './app'
let cr = null
let browsers = ['Chrome']
if (isTravis) {
cr = {
type: 'text'
}
browsers = ['Chrome_travis_ci'];
}
config.set({
basePath: '.',
files: [
'karma.shim.js'
],
reporters: ['progress', 'coverage'],
preprocessors: {
'karma.shim.js': ['webpack'],
},
webpack: {
cache: true,
devtool: 'inline-source-map',
entry: {},
output: {},
isparta: {
embedSource: true,
noAutoWrap: true,
// these babel options will be passed only to isparta and not to babel-loader
babel: {
presets: ['es2015']
}
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel',
query: {
presets: ['es2015']
}
},
// transpile and instrument only testing sources with isparta
{
test: /\.js$/,
include: /^(?!.*\-test.js$)[\/\w\.-]+$/,
exclude: /(node_modules|mocks.js)/,
loader: 'isparta'
}
]
},
resolve: {
root: [sourcePath],
modules: [
'node_modules',
sourcePath
]
}
},
coverageReporter: cr,
autoWatch: true,
frameworks: ['jasmine'],
browsers: browsers,
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-webpack',
'karma-coverage',
],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
}
});
}