-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.config.js
80 lines (74 loc) · 1.96 KB
/
karma.config.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
// Karma configuration
// Generated on Sat Jul 08 2017 00:12:18 GMT+0430 (IRDT)
const path = require('path')
module.exports = function (config) {
const configurations = {
basePath: '',
frameworks: ['jasmine'],
files: ['tests/index.test.js'],
exclude: ['dist'],
preprocessors: {
'tests/index.test.js': ['webpack', 'sourcemap']
},
client: {
serverUrl: config.serverUrl
},
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies
// webpack configuration
module: {
rules: [
// instrument only testing sources with Istanbul
{
test: /\.js$/,
use: {
loader: 'istanbul-instrumenter-loader',
options: { esModules: true }
},
include: path.resolve('src/'),
exclude: path.resolve('src/index.js')
}
]
},
resolve: {
alias: {
restfulpy: path.resolve(__dirname, 'src')
}
},
devtool: 'inline-source-map',
mode: 'development'
},
webpackMiddleware: {
stats: 'errors-only'
},
reporters: ['progress', 'coverage-istanbul', 'coveralls'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome_without_security'],
coverageIstanbulReporter: {
reports: ['html', 'text-summary', 'lcov', 'lcovonly'],
dir: 'coverage/'
},
customLaunchers: {
Chrome_without_security: {
base: 'Chrome',
flags: ['--disable-web-security']
},
Travis_CI_Chrome: {
base: 'ChromeHeadless',
flags: ['--disable-web-security', '--no-sandbox']
}
},
singleRun: true,
concurrency: Infinity
}
// Changing Testing browser in Travis
if (process.env.TRAVIS) {
configurations.browsers = ['Travis_CI_Chrome']
}
config.set(configurations)
}