Install any skill in seconds. Free to start, no credit card required.
Get Started Free →shinpr/frontend-typescript-testing
Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present.
Passed 20 of 23 test cases with the skill, and 15 of 23 without it.
and 2 more in the full report
5 fixed15 passed either way3 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
在测试用户列表接口时,我们需要使用 API 拦截工具模拟 `/api/users` 接口返回 200 OK 列表数据。请提供定义该网络 Handler 的 TypeScript 代码示例,并确保 Mock 数据形状不会与接口类型定义隐式脱节。
| Checked | Without skill | With skill |
|---|---|---|
| Uses the TypeScript satisfies operator to validate mock response payload types. | Missed | Passed |
The instructions your model reads when the skill loads.
在选择框架或命令之前,先检查 package.json、锁文件、测试配置以及现有测试的 import。仅在依赖/配置确实存在时才应用 Vitest、React Testing Library、MSW 或 Playwright 的规则。若仓库配置了不同的等效工具,则使用该工具。若无法确定可运行的测试工具,应报告已检查的路径以及缺失的框架或命令,而不是凭空指定。
| 测试类型 | 参考 | 使用场景 |
|---|---|---|
| 单元测试 / 集成测试 | 本文档 | 使用 RTL + Vitest + MSW 实现 React 组件测试 |
| E2E | references/e2e.md | 使用 Playwright 实现浏览器级 E2E 测试 |
import { describe, it, expect, beforeEach, vi } from 'vitest'import { render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'vi.mock()对于跨功能复用的共享组件、自定义 hook 和工具函数,应覆盖其公开分支、错误状态和边界契约,因为它们的回归影响范围更大。当行为依赖于多个已渲染单元时,通过集成测试/E2E 测试来验证页面级组合。
test cases passed, vs 15 / 23 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.