-
Notifications
You must be signed in to change notification settings - Fork 11
/
jest.config.js
44 lines (41 loc) · 1.04 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
module.exports = {
testEnvironment: 'node',
testEnvironmentOptions: {
customExportConditions: [
'node',
'node-addons'
]
},
preset: 'ts-jest',
moduleFileExtensions: ['js', 'ts', 'vue'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(png|jpeg|jpg|gif)$': 'identity-obj-proxy',
'\\.(ttf|woff|woff2)$': 'identity-obj-proxy',
'iconfont\\.js$': 'identity-obj-proxy'
},
testMatch: ['<rootDir>/__tests__/**/*.spec.ts'],
transformIgnorePatterns: ['/node_modules/'],
transform: {
'^.+\\.(js|ts)$': '@sucrase/jest-plugin',
'^.+\\.(vue)$': '@vue/vue3-jest'
},
coverageDirectory: 'coverage',
coverageReporters: ['html', 'lcov', 'text'],
coverageProvider: 'v8',
collectCoverageFrom: [
// 'src/**/*.vue',
'src/modules/**/components/*.vue',
'src/components/**/*.vue'
// 'src/widgets/**/*.vue'
],
coverageThreshold: {
global: {
branches: 40,
functions: 80,
lines: 90,
statements: 80
}
}
}