mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-24 00:53:52 +00:00
Document API_PREFIX, folder structure, templates, and E2E script usage in en/zh. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
676 B
Plaintext
25 lines
676 B
Plaintext
---
|
||
title: 运行测试
|
||
description: Vitest 单元测试与 Playwright E2E
|
||
---
|
||
|
||
# 运行测试
|
||
|
||
## 单元测试(Vitest)
|
||
|
||
```bash
|
||
pnpm run test:unit
|
||
```
|
||
|
||
由 **Vite+** 封装 Vitest,请勿脱离 `vp`/`pnpm scripts` 随意单独安装冲突版本的 Vitest(参见各应用 **`AGENTS.md`**)。
|
||
|
||
## E2E(Playwright)
|
||
|
||
```bash
|
||
pnpm run test:e2e # 全部
|
||
pnpm run test:e2e -- e2e/login.spec.ts e2e/users.spec.ts # 核心流程
|
||
pnpm run test:e2e -- e2e/auth-refresh.spec.ts e2e/rbac.spec.ts e2e/url-state.spec.ts
|
||
```
|
||
|
||
首次在机器上跑 E2E 前,按 Playwright 文档安装浏览器依赖(`pnpm exec playwright install` 等,以官方说明为准)。
|