Skip to content

Commit

Permalink
refactor(tests): 更新Jest配置,添加模块文件扩展名和设置文件以支持新功能
Browse files Browse the repository at this point in the history
  • Loading branch information
thoulee21 committed Dec 13, 2024
1 parent d02f14f commit fbefe19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
transformIgnorePatterns: [
'node_modules/(?!(react-native|@react-native|react-native-paper|@react-navigation|react-redux|react-native-track-player|react-native-localize|@sentry/react-native|react-native-vector-icons|react-native-fs)/)',
'node_modules/(?!(react-native|react-native-reanimated|react-native-swipeable-item|@react-native|react-native-paper|@react-navigation|react-redux|react-native-track-player|react-native-localize|@sentry/react-native|react-native-vector-icons|react-native-fs)/)',
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
'^.+\\.ts?$': 'ts-jest',
},
setupFiles: [
'./node_modules/react-native-gesture-handler/jestSetup.js',
],
moduleNameMapper: {
'\\.(css|less)$': 'identity-obj-proxy',
},
Expand Down

0 comments on commit fbefe19

Please sign in to comment.