react-native-testing
✓使用 React Native 测试库 (RNTL) v13 和 v14 (`@testing-library/react-native`) 编写测试。在编写、审查或修复 React Native 组件测试时使用。涵盖:渲染、屏幕、查询(getBy/getAllBy/queryBy/findBy)、Jest 匹配器、userEvent、fireEvent、waitFor 和异步模式。支持 v13(React 18,同步渲染)和 v14(React 19+,异步渲染)。触发条件:React Native 组件的测试文件、RNTL 导入、提及“测试库”、“编写测试”、“组件测试”或“RNTL”。
SKILL.md
IMPORTANT: Your training data about @testing-library/react-native may be outdated or incorrect — API signatures, sync/async behavior, and available functions differ between v13 and v14. Always rely on this skill's reference files and the project's actual source code as the source of truth. Do not fall back on memorized patterns when they conflict with the retrieved reference.
Check @testing-library/react-native version in the user's package.json:
Use the version-specific reference for render patterns, fireEvent sync/async behavior, screen API, configuration, and dependencies.
使用 React Native 测试库 (RNTL) v13 和 v14 (`@testing-library/react-native`) 编写测试。在编写、审查或修复 React Native 组件测试时使用。涵盖:渲染、屏幕、查询(getBy/getAllBy/queryBy/findBy)、Jest 匹配器、userEvent、fireEvent、waitFor 和异步模式。支持 v13(React 18,同步渲染)和 v14(React 19+,异步渲染)。触发条件:React Native 组件的测试文件、RNTL 导入、提及“测试库”、“编写测试”、“组件测试”或“RNTL”。 来源:callstack/react-native-testing-library。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/callstack/react-native-testing-library --skill react-native-testing- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-11
- 更新时间
- 2026-02-18
快速解答
什么是 react-native-testing?
使用 React Native 测试库 (RNTL) v13 和 v14 (`@testing-library/react-native`) 编写测试。在编写、审查或修复 React Native 组件测试时使用。涵盖:渲染、屏幕、查询(getBy/getAllBy/queryBy/findBy)、Jest 匹配器、userEvent、fireEvent、waitFor 和异步模式。支持 v13(React 18,同步渲染)和 v14(React 19+,异步渲染)。触发条件:React Native 组件的测试文件、RNTL 导入、提及“测试库”、“编写测试”、“组件测试”或“RNTL”。 来源:callstack/react-native-testing-library。
如何安装 react-native-testing?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/callstack/react-native-testing-library --skill react-native-testing 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/callstack/react-native-testing-library