-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
125 lines (111 loc) · 3.17 KB
/
Copy pathjest.config.js
File metadata and controls
125 lines (111 loc) · 3.17 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*!
* Configuration for the WikiLambda browser jest UX unit testing suite
*
* @copyright 2020– Abstract Wikipedia team; see AUTHORS.txt
* @license MIT
*/
'use strict';
module.exports = {
// Vue-jest specific global options (described here: https://github.com/vuejs/vue-jest#global-jest-options)
globals: {
babelConfig: false,
hideStyleWarn: true,
experimentalCssCompile: true
},
// This and "transform" below are the most crucial for vue-jest:
// https://github.com/vuejs/vue-jest#setup
moduleFileExtensions: [
'js',
'json',
'vue'
],
moduleNameMapper: {
'codex.js': '<rootDir>/tests/jest/helpers/loadCodexComponents.js',
'icons.json': '<rootDir>/tests/jest/fixtures/icons.js',
'mediawiki.DateFormatter': '<rootDir>/tests/jest/helpers/mockDateFormatter.js'
},
transform: {
'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue3-jest'
},
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: [ 'node', 'node-addons' ]
},
clearMocks: true,
coverageProvider: 'v8',
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns of the files for which coverage information should be collected
collectCoverageFrom: [
'resources/**/*.(js|vue)'
],
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
// Ignore upstream libraries
'resources/lib/',
// Ignore index.js initialization scripts
'resources/ext.wikilambda.app/index.js',
'resources/ext.wikilambda.app/components/index.js',
'resources/ext.wikilambda.app/Constants.js',
'resources/ext.wikilambda.languageselector/index.js',
// Ignore VisualEditor initialization scripts
'resources/ext.wikilambda.visualeditor/',
// Ignore references initialization scripts and trigger composable (might change)
'resources/ext.wikilambda.references/init.js',
'resources/ext.wikilambda.references/vue.js',
// Ignore search module index
'resources/ext.wikilambda.search/index.js',
// Ignore image initialization scripts
'resources/ext.wikilambda.image/init.js'
],
coverageThreshold: {
// This is our soft target, but doesn't actually affect any of our code as we over-ride
// below for now
global: {
branches: 90,
lines: 90,
functions: 90,
statements: 90
},
'./resources/ext.wikilambda.languageselector/': {
branches: 93,
lines: 98,
functions: 94,
statements: 98
},
'./resources/ext.wikilambda.app/': {
branches: 85,
lines: 95,
functions: 95,
statements: 95
},
'./resources/ext.wikilambda.app/composables': {
branches: 82,
lines: 88,
functions: 98,
statements: 88
},
'./resources/ext.wikilambda.app/utils': {
branches: 82,
lines: 88,
functions: 98,
statements: 88
},
'./resources/ext.wikilambda.app/store': {
branches: 84,
lines: 94,
functions: 97,
statements: 94
}
},
// The paths to modules that run some code to configure or set up the testing environment
// before each test
setupFiles: [
'./jest.setup.js'
],
setupFilesAfterEnv: [
'./jest.setupAfterEnv.js'
]
};