Community程式設計與開發github.com

callstack/react-native-testing

使用 React Native Testing Library (RNTL) v13 和 v14 (`@testing-library/react-native`) 編寫測試。適用於撰寫、審查或修正 React Native 元件測試。

react-native-testing 是什麼?

此技能專為使用 React Native Testing Library (RNTL) 撰寫 React Native 元件測試而設計,全面支援 v13 (React 18,同步渲染) 和 v14 (React 19+,非同步渲染) 兩個主要版本。它涵蓋了關鍵的測試 API,包括 `render`、`screen`、各種查詢方法 (`getBy`/`getAllBy`/`queryBy`/`findBy`),以及 Jest 斷言匹配器。此外,還支援 `userEvent`、`fireEvent`、`waitFor` 以及非同步測試模式。當開發者處理 React Native 元件的測試檔案、匯入 RNTL 模組,或提及「testing library」、「write tests」、「component tests」、「RNTL」等關鍵字時,此技能會自動觸發。它提供了一個全面的開發環境,讓你可以有效率地撰寫、審查與修正測試案例,確保測試涵蓋從同步到非同步 UI 行為的所有場景,從而提升元件的可靠性與程式碼品質。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/callstack/react-native-testing-library/tree/main/skills/react-native-testing

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

react-native-testing 是做什麼的?

使用 React Native Testing Library (RNTL) v13 和 v14 (@testing-library/react-native) 編寫測試。適用於撰寫、審查或修正 React Native 元件測試。涵蓋:render、screen、查詢方法 (getBy/getAllBy/queryBy/findBy)、Jest 匹配器、userEvent、fireEvent、waitFor 和非同步模式。支援 v13 (React 18,同步渲染) 和 v14 (React 19+,非同步渲染)。觸發條件:React Native 元件的測試檔案、RNTL 匯入、提及「testing library」、「write tests」、「component tests」或「RNTL」。

相關技能