-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
72 lines (66 loc) · 1.47 KB
/
jest.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
/**
* (c) 2010-present DEMOS plan GmbH.
*
* This file is part of the package demosplan,
* for more information see the license file.
*
* All rights reserved
*/
const config = require('./client/fe/config/config').config
const webpackConfig = require('./config.webpack')
const aliases = webpackConfig[0].resolve.alias
delete aliases.vue
const roots = {}
for (const alias in aliases) {
const from = alias + '/(.*)$'
const to = aliases[alias] + '/$1'
roots[from] = to
}
module.exports = {
// Verbose: true, // enable to see result of each test case
testEnvironment: 'jsdom',
testRegex: '/tests/.*(test|spec)\\.js?$',
rootDir: config.absoluteRoot,
roots: [
'tests/frontend/'
],
moduleDirectories: [
'node_modules'
],
moduleFileExtensions: [
'js',
'json',
'vue'
],
moduleNameMapper: roots,
modulePaths: [
'<rootDir>'
],
transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue2-jest'
},
transformIgnorePatterns: [
'/node_modules/demosplan-ui'
],
// Send a notification when tests fail or once when they pass
notifyMode: 'failure-success',
reporters: [
'default',
[
'jest-junit',
{
suiteName: 'Jest Tests',
outputName: 'jenkins-build-jest.junit.xml',
outputDirectory: '.build/'
}
]
],
globals: {
'@vue/vue2-jest': {
babelConfig: {
plugins: ['dynamic-import-node']
}
}
}
}