Initial commit: Book management system with Rust Loco backend and Vue 3 frontend
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# 运行测试
|
||||
|
||||
## 运行所有测试
|
||||
|
||||
```bash
|
||||
cargo test
|
||||
```
|
||||
|
||||
## 运行特定测试模块
|
||||
|
||||
### 运行 books API 测试
|
||||
```bash
|
||||
cargo test books
|
||||
```
|
||||
|
||||
### 运行 auth API 测试
|
||||
```bash
|
||||
cargo test auth
|
||||
```
|
||||
|
||||
## 运行单个测试
|
||||
|
||||
```bash
|
||||
cargo test can_list_books_with_pagination
|
||||
```
|
||||
|
||||
## 显示测试输出
|
||||
|
||||
```bash
|
||||
cargo test -- --nocapture
|
||||
```
|
||||
|
||||
## 测试覆盖的接口
|
||||
|
||||
### Books API
|
||||
- ✅ GET /api/books - 获取图书列表(支持分页)
|
||||
- ✅ GET /api/books/:id - 获取单本图书
|
||||
- ✅ POST /api/books - 创建图书(需要认证)
|
||||
- ✅ PUT /api/books/:id - 更新图书(需要认证)
|
||||
- ✅ DELETE /api/books/:id - 删除图书(需要认证)
|
||||
|
||||
### Auth API
|
||||
- ✅ POST /api/auth/register - 用户注册
|
||||
- ✅ POST /api/auth/login - 用户登录
|
||||
- ✅ POST /api/auth/verify - 验证邮箱
|
||||
|
||||
## 测试说明
|
||||
|
||||
所有测试使用独立的测试数据库,不会影响开发环境的数据。
|
||||
测试会自动清理创建的测试数据。
|
||||
Reference in New Issue
Block a user