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