Files
expo-popcore-app/jest.config.js
imeepos 1f9b6e22d6 feat: 添加测试框架和优化项目结构
- 添加 Jest 配置和测试设置
- 添加 use-categories hook 的单元测试
- 更新 CLAUDE.md 添加包管理工具说明
- 优化首页、视频页和频道页的组件结构
- 添加 .claude 命令配置文件
- 移除 bun.lock 和 package-lock.json,统一使用 bun
- 更新 package.json 依赖

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 10:53:54 +08:00

39 lines
1.1 KiB
JavaScript

const { defaults: tsjPresets } = require('ts-jest/presets')
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'react-native',
transformIgnorePatterns: [
'node_modules/(?!(@react-native|react-native|@react-navigation|expo|expo-.*|@expo|@react-native-community|react-native-.*|@shopify|@better-auth|nativewind|react-native-css-interop)/)',
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['ts-jest', tsjPresets.defaults],
},
testMatch: ['**/__tests__/**/*.(test|spec).(js|jsx|ts|tsx)', '**/*.(test|spec).(js|jsx|ts|tsx)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/node_modules/**',
'!**/android/**',
'!**/ios/**',
'!**/coverage/**',
'!**/.claude/**',
'!**/jest.config.js',
'!**/jest.setup.js',
'!**/metro.config.js',
],
globals: {
'ts-jest': {
tsconfig: {
jsx: 'react',
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
},
},
}