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
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
2018-07-27 18:31:34 +08:00
|
|
|
testURL: 'http://localhost/',
|
2018-05-13 23:11:51 +08:00
|
|
|
setupFiles: [
|
|
|
|
'./tests/setup.js',
|
|
|
|
],
|
|
|
|
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/',
|
|
|
|
],
|
|
|
|
testPathIgnorePatterns: [
|
|
|
|
'/node_modules/',
|
|
|
|
'node',
|
|
|
|
],
|
|
|
|
transform: {
|
|
|
|
".*\\.(vue|md)$": "<rootDir>/node_modules/vue-jest",
|
|
|
|
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest"
|
|
|
|
},
|
|
|
|
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
|
|
|
|
moduleNameMapper: {
|
|
|
|
"^@/(.*)$": "<rootDir>/$1",
|
|
|
|
"vue-antd-ui": "<rootDir>/components/index.js",
|
|
|
|
},
|
|
|
|
snapshotSerializers: [
|
|
|
|
"<rootDir>/node_modules/jest-serializer-vue"
|
|
|
|
],
|
|
|
|
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,
|
|
|
|
};
|