forked from suning-cloud-team/uxcool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
33 lines (33 loc) · 1.3 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
module.exports = {
// projects 指定怎么运行jest, 如果多个配置则会在每个路径中运行jest,并且使用路径中jest.config
projects: ['<rootDir>'],
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
moduleNameMapper: {
'@cloud-sn/v-datepicker/es/locale/([^/]+)': '<rootDir>/packages/v-datepicker/src/locale/$1',
'@cloud-sn/v-tooltip/es/placements$': '<rootDir>/packages/v-tooltip/src/placements.js',
'@cloud-sn/(v-(?!test-utils)[^/]+)': '<rootDir>/packages/$1/src/',
},
transform: {
'.+\\.vue$': require.resolve('vue-jest'),
'\\.jsx?$': [require.resolve('babel-jest'), { rootMode: 'upward' }],
},
transformIgnorePatterns: ['/node_modules/'],
testEnvironment: 'jest-environment-jsdom-fifteen',
snapshotSerializers: ['jest-serializer-vue'],
testMatch: ['**/__tests__/**/*.spec.[jt]s?(x)'],
collectCoverageFrom: [
'packages/uxcool/src/components/**/*.{js,vue,jsx}',
// 'packages/v-datepicker/@(cjs|es|src)/**/*.{js,vue,jsx}',
'packages/v-*/src/**/*.{js,vue,jsx}',
'!**/__tests__/**',
'!**/style/index.js',
'!**/locale/*.js',
'!**/virtual-list/**',
// '!**/mixins/**',
],
testURL: 'http://localhost',
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
};