瀏覽代碼

docs(architecture): 基于实际测试实现重写后端模块测试规范

修正了文档中与实际实现不符的描述:

**架构修正**:
- 测试文件位于各模块包内的tests/目录,而非独立packages/*-module
- 使用@d8d/shared-test-util作为共享测试基础设施
- 集成测试使用真实PostgreSQL数据库,非内存数据库

**测试工具修正**:
- 使用hono/testing的testClient进行API测试
- 使用IntegrationTestDatabase管理测试数据库
- 使用setupIntegrationDatabaseHooksWithEntities管理测试生命周期

**配置修正**:
- vitest.config.ts中fileParallelism: false避免数据库连接冲突
- 实际的测试文件结构和命名约定

**示例代码**:
- 基于user.routes.integration.test.ts的真实集成测试示例
- 基于file.service.test.ts的真实单元测试示例
- 基于integration-test-db.ts的测试数据工厂模式

**参考实现**:
- packages/core-module/*/tests/
- allin-packages/*/tests/

🤖 Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 3 周之前
父節點
當前提交
3b4810529c
共有 1 個文件被更改,包括 736 次插入524 次删除
  1. 736 524
      docs/architecture/backend-module-testing-standards.md

File diff suppressed because it is too large
+ 736 - 524
docs/architecture/backend-module-testing-standards.md


Some files were not shown because too many files changed in this diff