-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
29 lines (29 loc) · 1.14 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
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
moduleDirectories: ['node_modules'],
testMatch: [
'<rootDir>/packages/components/**/__test__/**/*.[t|j]s?(x)',
'<rootDir>/packages/vue3/**/__test__/**/*.[t|j]s?(x)',
],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'@snow-design/components(.*)$': '<rootDir>/packages/components/$1',
'@snow-design/foundation(.*)$': '<rootDir>/packages/foundation/$1',
'@snow-design/vue3(.*)$': '<rootDir>/packages/vue3/$1',
'@snow-design/locale(.*)$': '<rootDir>/packages/locale/$1',
'#test(.*)$': '<rootDir>/test/$1',
},
testEnvironmentOptions: {
// 解决 Vue is not defined 问题 https://github.com/vuejs/vue-test-utils/issues/1975
customExportConditions: ['node', 'node-addons'],
},
collectCoverageFrom: [
'packages/components/**/*.{ts,tsx}',
'packages/foundation/**/*.{ts,tsx}',
'!packages/components/index.ts',
'!packages/components/**/_story/*',
'!packages/components/{lib,dist}/**/*',
'!packages/foundation/{lib,dist}/**/*',
],
};