ant-design-vue/.jest.js

53 lines
1.4 KiB
JavaScript
Raw Normal View History

2018-05-13 23:11:51 +08:00
const libDir = process.env.LIB_DIR;
const transformIgnorePatterns = [
'/dist/', 'node_modules\/[^/]+?\/(?!(es|node_modules)\/)', // Ignore modules without es dir
2018-05-13 23:11:51 +08:00
];
module.exports = {
2018-07-27 18:31:34 +08:00
testURL: 'http://localhost/',
setupFiles: ['./tests/setup.js'],
2018-05-13 23:11:51 +08:00
moduleFileExtensions: [
"js",
"jsx",
"json",
"vue",
2018-07-20 16:13:21 +08:00
"md",
"jpg"
2018-05-13 23:11:51 +08:00
],
modulePathIgnorePatterns: ['/_site/'],
2018-05-13 23:11:51 +08:00
testPathIgnorePatterns: [
'/node_modules/', 'node'
2018-05-13 23:11:51 +08:00
],
transform: {
".*\\.(vue|md)$": "<rootDir>/node_modules/vue-jest",
2019-03-11 21:06:53 +08:00
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.svg$": "<rootDir>/node_modules/jest-transform-stub"
2018-05-13 23:11:51 +08:00
},
testRegex: libDir === 'dist'
? 'demo\\.test\\.js$'
: '.*\\.test\\.js$',
2018-05-13 23:11:51 +08:00
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
2019-02-01 17:23:00 +08:00
"ant-design-vue": "<rootDir>/components/index.js",
"^vue$": "vue/dist/vue.common.js"
2018-05-13 23:11:51 +08:00
},
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"],
2018-05-13 23:11:51 +08:00
collectCoverage: process.env.COVERAGE === 'true',
collectCoverageFrom: [
"components/**/*.{js,jsx,vue}",
'!components/*/style/index.{js,jsx}',
2018-05-14 10:20:05 +08:00
'!components/style/*.{js,jsx}',
'!components/*/locale/*.{js,jsx}',
2018-05-13 23:11:51 +08:00
'!components/*/__tests__/**/type.{js,jsx}',
2018-05-14 10:20:05 +08:00
'!components/vc-*/**/*',
'!components/*/demo/**/*',
'!components/_util/**/*',
'!components/align/**/*',
'!components/trigger/**/*',
'!components/style.js',
2018-05-13 23:11:51 +08:00
"!**/node_modules/**"
],
transformIgnorePatterns
2018-05-13 23:11:51 +08:00
};