Commit ba87845a authored by Sendya's avatar Sendya

fix: jest test script

parent 9f260651
......@@ -5,17 +5,18 @@ module.exports = {
testURL: 'http://localhost/',
preset: 'ts-jest',
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'vue'],
modulePathIgnorePatterns: ['/_site/'],
modulePathIgnorePatterns: ['/_site/', '/examples/'],
transform: {
// '^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/jest/jestpreprocessor.js',
'^.+\\.js$': 'babel-jest',
'^.+\\.(ts|tsx)$': 'ts-jest',
// '^.+\\.svg$': '<rootDir>/node_modules/jest-transform-stub',
'^.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
},
testRegex: libDir === 'dist' ? 'demo\\.test\\.ts$' : '.*\\.test\\.tsx$',
testEnvironment: 'jest-environment-jsdom-fifteen',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
// '^.*ant-design/icons.*\\.js': '<rootDir>/node_modules/babel-jest',
// '^.*lodash-es.*\\.js': '<rootDir>/node_modules/babel-jest',
// '^.*ant-design-vue.*[.]?style|css|less.*$': 'jest-transform-stub',
},
......@@ -27,7 +28,7 @@ module.exports = {
'/dist/',
// Ignore modules without es dir.
// Update: @babel/runtime should also be transformed
'<rootDir>/node_modules/(?!(lodash-es|ant-design-vue/es))',
'<rootDir>/node_modules/(?!(lodash-es|ant-design-vue/es|@ant-design/icons-vue|@ant-design/icons-svg))',
],
verbose: true,
globals: {
......
......@@ -13,6 +13,7 @@ module.exports = {
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-modules-commonjs',
// 'transform-es2015-modules-commonjs',
],
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment