forked from claroline/Distribution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
65 lines (62 loc) · 1.44 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
const paths = require('./main/core/Resources/server/paths')
const webpackConfig = require('./webpack.test')
module.exports = config => {
const base = {
basePath: '',
frameworks: ['mocha'],
files: [
{
pattern: 'main/core/Resources/modules/core-js/index.js',
watched: false
},
{
pattern: 'main/core/Resources/modules/fetch-shim/index.js',
watched: false
},
'*/*/Resources/modules/**/*\.test.js'
],
preprocessors: {
'./*/*/Resources/modules/**/[^.]+.js': ['coverage'],
'./*/*/Resources/modules/**/*.js': ['webpack']
},
reporters: ['dots'],
port: 9876,
colors: true,
logLevel: config.LOG_WARN,
client: {
captureConsole: true,
mocha: {
bail: true
}
},
customLaunchers: {
ChromeTravis: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
coverageReporter: {
includeAllSources: true,
reporters:[
{
type: 'html',
dir: `${paths.root()}/coverage`
}
]
},
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
failOnEmptyTestSuite: false,
concurrency: Infinity,
webpack: webpackConfig,
webpackServer: {
quiet: true
}
}
// see https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
if (process.env.TRAVIS) {
base.browsers = ['ChromeTravis']
}
config.set(base)
}