Skip to main content

write-e2e-cases

Use when adding or updating Rsdoctor end-to-end tests in `e2e/cases/`, including new feature coverage, bug reproduction, and regression prevention.

来源信息

仓库
web-infra-dev/rsdoctor
最近来源活动
2026年8月31日 08:03
检测到的 SKILL.md 语言
英语
星标
1,151
Forks
107

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
write-e2e-cases
description
Use when adding or updating Rsdoctor end-to-end tests in `e2e/cases/`, including new feature coverage, bug reproduction, and regression prevention.
# Write E2E cases Rsdoctor E2E tests use **Playwright** and live under `e2e/cases/`. Each bundler has its own directory: - `e2e/cases/doctor-rspack/` — tests using Rspack compilation - `e2e/cases/doctor-rsbuild/` — tests using Rsbuild - `e2e/cases/doctor-rspeedy/` — tests using Rspeedy ## Steps 1. Review uncommitted git changes to define test scope and target behavior. 2. Read `e2e/README.md` and follow its conventions. 3. Use helpers from `@scripts/test-helper` (for example `compileByRspack`) to compile fixtures. Do **not** call bundler APIs directly. 4. Add Playwright test files under the appropriate `e2e/cases/doctor-*` directory, following existing patterns. 5. Test fixtures (source files, loaders, configs) go in `fixtures/` subdirectories inside each case directory. 6. Keep assertions focused and readable; avoid redundant setup and checks. 7. Run `pnpm e2e` from the repository root to validate. ## Case structure - Each test file creates an Rsdoctor plugin instance (e.g., `createRsdoctorPlugin` from a local `test-utils.ts`), compiles a fixture via `compileByRspack`, and asserts on the SDK store data. - Fixtures are plain JS/TS files and loaders in `fixtures/` — not full application directories. - Use `@rsdoctor/core/plugins` for `getSDK` / `setSDK` when inspecting analysis results. ## Constraints - If tests can pass only after source-code changes, do not change source code directly. Explain the required source change and ask the user before proceeding.
在 GitHub 查看