2019-07-13 10:29:47 +08:00
|
|
|
const { moduleNameMapper, transformIgnorePatterns } = require('./.jest');
|
2019-06-17 12:00:52 +08:00
|
|
|
|
2018-12-17 16:10:58 +08:00
|
|
|
// jest config for server render environment
|
2017-06-30 15:29:28 +08:00
|
|
|
module.exports = {
|
2018-12-16 11:26:36 +08:00
|
|
|
setupFiles: ['./tests/setup.js'],
|
2020-04-06 12:05:38 +08:00
|
|
|
setupFilesAfterEnv: ['./tests/setupAfterEnv.ts'],
|
2018-12-17 16:10:58 +08:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'md'],
|
2019-07-13 10:29:47 +08:00
|
|
|
moduleNameMapper,
|
2017-06-30 15:29:28 +08:00
|
|
|
transform: {
|
2019-08-01 15:28:16 +08:00
|
|
|
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
|
|
|
|
'\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
|
|
|
|
'\\.md$': './node_modules/@ant-design/tools/lib/jest/demoPreprocessor',
|
|
|
|
'\\.(jpg|png|gif|svg)$': './node_modules/@ant-design/tools/lib/jest/imagePreprocessor',
|
2017-06-30 15:29:28 +08:00
|
|
|
},
|
2020-04-13 13:36:23 +08:00
|
|
|
testRegex: 'demo\\.test\\.(j|t)s$',
|
2017-06-30 15:29:28 +08:00
|
|
|
testEnvironment: 'node',
|
2019-06-17 12:00:52 +08:00
|
|
|
transformIgnorePatterns,
|
2018-12-16 11:26:36 +08:00
|
|
|
snapshotSerializers: ['enzyme-to-json/serializer'],
|
2017-06-30 15:29:28 +08:00
|
|
|
};
|