·testing-library
</>

testing-library

jezweb/claude-skills

使用测试库模式测试 React 组件。涵盖查询 (getBy/findBy/queryBy)、用户事件交互、异步测试(findBy 与 waitFor)、可访问性测试以及用于 API 模拟的 MSW 集成。 使用场合:测试 React 组件、模拟用户交互、测试表单、使用 MSW 模拟 API 调用或编写可访问的测试。关键词:测试库、反应测试库、getByRole、用户事件、waitFor、MSW、屏幕。

196安装·42热度·@jezweb

安装

$npx skills add https://github.com/jezweb/claude-skills --skill testing-library

SKILL.md

Status: Production Ready Last Updated: 2026-02-06 Version: 16.x User Event: 14.x

| 1 | getByRole | Buttons, links, headings, inputs | | 2 | getByLabelText | Form inputs with labels | | 3 | getByPlaceholderText | Inputs without visible labels | | 4 | getByText | Non-interactive text content | | 5 | getByTestId | Last resort only |

| Variant | Returns | Throws | Use For |

使用测试库模式测试 React 组件。涵盖查询 (getBy/findBy/queryBy)、用户事件交互、异步测试(findBy 与 waitFor)、可访问性测试以及用于 API 模拟的 MSW 集成。 使用场合:测试 React 组件、模拟用户交互、测试表单、使用 MSW 模拟 API 调用或编写可访问的测试。关键词:测试库、反应测试库、getByRole、用户事件、waitFor、MSW、屏幕。 来源:jezweb/claude-skills。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/jezweb/claude-skills --skill testing-library
分类
</>开发工具
认证
收录时间
2026-02-07
更新时间
2026-02-18

快速解答

什么是 testing-library?

使用测试库模式测试 React 组件。涵盖查询 (getBy/findBy/queryBy)、用户事件交互、异步测试(findBy 与 waitFor)、可访问性测试以及用于 API 模拟的 MSW 集成。 使用场合:测试 React 组件、模拟用户交互、测试表单、使用 MSW 模拟 API 调用或编写可访问的测试。关键词:测试库、反应测试库、getByRole、用户事件、waitFor、MSW、屏幕。 来源:jezweb/claude-skills。

如何安装 testing-library?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/jezweb/claude-skills --skill testing-library 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/jezweb/claude-skills