rn-testing
React Native アプリを確実にテストする
React Native のテストは、ネイティブモジュール、ストア、非同期フローが一貫してモックされていないと失敗しがちです。このスキルは、実践的な Jest と React Native Testing Library のパターンを提供します。
自分のエージェントでインストール
このリクエストをエージェントにコピーしてください。正規の Skill ページとマニフェストが含まれています。
Review the Skillstore skill "rn-testing" from https://skillstore.io/skills/cjharmath-rn-testing.md and its manifest at https://skillstore.io/api/skills/cjharmath-rn-testing/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.エージェントは引き続き計画を提示し、セキュリティポリシーで必要な確認を求める必要があります。
エージェントが読めるリソース
AI エージェント、クローラー、スクリプトがページ全体ではなく整理されたコンテキストを必要とする場合は、これらのリンクを使ってください。
テストする
「rn-testing」を使用しています。 ユーザーが、非同期呼び出し後に answers を更新する Zustand アクションのテスト方法を尋ねる。
期待される結果:
- 各テストの前に、状態全体の置換でストアをリセットします。
- 非同期アクションを act でラップします。
- 最終的な answer の値をアサートする前に、新しい状態を読み取ります。
「rn-testing」を使用しています。 ユーザーが、React Native テストで act 警告が表示される理由を尋ねる。
期待される結果:
レスポンスでは、アサーション後に非同期更新が完了したことを説明します。最終的な UI 状態を待つことを推奨します。
「rn-testing」を使用しています。 ユーザーが、Jest で Expo モジュールをモックする方法を尋ねる。
期待される結果:
レスポンスでは、router、secure storage、constants、haptics に必要なモックを特定し、まずグローバル Jest セットアップを確認します。
セキュリティ監査
安全All 29 static findings were adjudicated as false positives. The matches are markdown code fences, inline references, documented npm test commands, a local mock URL, and Object.keys in a test assertion. No prompt injection, malicious intent, credential handling, or live network behavior was found in SKILL.md.
リスク要因
⚙️ 外部コマンド (27)
🌐 ネットワークアクセス (1)
このレポートを共有・引用
バージョン付き評価レポート、中立的なバッジ、埋め込みカード、引用を共有できます。Skillstore は証拠を報告しますが、この Skill が安全かどうかは判断しません。
レポートリンクをコピー
https://skillstore.io/skills/cjharmath-rn-testing/audits/7?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdownバッジ
[](https://skillstore.io/skills/cjharmath-rn-testing?utm_source=security_passport_badge)HTMLバッジ
<a href="https://skillstore.io/skills/cjharmath-rn-testing?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/cjharmath-rn-testing/security.svg" alt="Skillstore security assessment" loading="lazy"></a>埋め込みカード
<iframe src="https://skillstore.io/embed/skills/cjharmath-rn-testing.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学術引用 (APA · BibTeX · CFF)
APA形式の引用
CJHarmath. (2026). rn-testing security audit report (audit version 7) [Author version unspecified]. Skillstore. https://skillstore.io/skills/cjharmath-rn-testing/audits/7BibTeX形式の引用
@techreport{cjharmath-cjharmath-rn-testing-2026,
author = {CJHarmath},
title = {rn-testing security audit report (audit version 7)},
institution = {Skillstore},
year = {2026},
number = {7},
url = {https://skillstore.io/skills/cjharmath-rn-testing/audits/7},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "rn-testing security audit report (audit version 7)"
version: "unspecified"
type: report
authors:
- name: "CJHarmath"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/cjharmath-rn-testing/audits/7"
identifiers:
- type: other
value: "skillstore:cjharmath-rn-testing:audit:7"
description: "Skillstore immutable audit report identifier"
Skillstore スコア
このスコアの理由 証拠の信頼度: 高作成できるもの
ストアテストを安定化する
Zustand の状態をリセットし、テスト間の漏れなく非同期アクションを検証します。
Expo モジュールをモックする
ルーティング、セキュアストレージ、定数、ハプティクス向けの Jest モックを作成またはレビューします。
テスト失敗をデバッグする
act 警告、モジュールマッピングエラー、非同期タイムアウト、壊れやすいスナップショットを解決します。
これらのプロンプトを試す
React Native Testing Library で React Native コンポーネントをテストする方法を教えてください。イベント処理と非同期アサーションを含めてください。
Zustand ストア向けの Jest テストを書くのを手伝ってください。各テストの前に状態をリセットし、act と waitFor で非同期アクションを検証してください。
この React Native テストスイートについて、不安定な非同期動作、不足している Expo モック、壊れやすいスナップショットをレビューしてください。焦点を絞った変更を提案してください。
Expo Router、React Query、Zustand、生成された API フックを使用する React Native 機能のテスト戦略を設計してください。モックとアサーションを含めてください。
ベストプラクティス
- すべてのテストの前に共有ストアの状態をリセットします。
- アサートする前に、非同期の UI またはストア更新を待ちます。
- 広範なスナップショットよりも、振る舞いのアサーションを優先します。
回避
- 前のテストが残した状態に依存しないでください。
- 動的なリストや頻繁に変更される画面をスナップショット化しないでください。
- グローバル Jest セットアップを確認せずにモックを重複させないでください。