Files
antd-admin/apps/docs/content/zh/testing/running-tests.mdx
zuiideaandCursor b8bb7713b3 docs: align site with modular src/api layout
Document API_PREFIX, folder structure, templates, and E2E script usage in en/zh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 21:17:47 +08:00

25 lines
676 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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` 等,以官方说明为准)。