主要更改: - 重构测试文件结构,删除旧的测试文件并添加新的测试覆盖 - 添加 DynamicForm 组件及其测试 - 更新 Jest 配置以支持新的测试结构 - 更新组件、抽屉和国际化文件 Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
982 B
JavaScript
35 lines
982 B
JavaScript
const { getDefaultConfig } = require('expo/metro-config')
|
|
const { withNativeWind } = require('nativewind/metro')
|
|
|
|
const config = getDefaultConfig(__dirname)
|
|
|
|
/**
|
|
* Exclude test files from Metro bundler
|
|
* https://www.better-auth.com/docs/integrations/expo#expo-client
|
|
*/
|
|
config.resolver.sourceExts = config.resolver.sourceExts.filter(ext => ext !== 'test')
|
|
config.resolver.resolverMainFields = ['react-native', 'browser', 'main']
|
|
|
|
// Exclude test files from being bundled
|
|
config.resolver.blockList = [
|
|
/.*\.test\.[jt]sx?$/,
|
|
/.*\.spec\.[jt]sx?$/,
|
|
]
|
|
|
|
config.server = {
|
|
...config.server,
|
|
enhanceMiddleware: (middleware) => {
|
|
return (req, res, next) => {
|
|
// Block requests to test files
|
|
if (req.url.match(/\.(test|spec)\.(js|jsx|ts|tsx)$/)) {
|
|
res.statusCode = 404
|
|
res.end('Test files are not served')
|
|
return
|
|
}
|
|
return middleware(req, res, next)
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = withNativeWind(config, { input: './global.css' })
|