์Šคํ‚ฌ mobile-testing
๐Ÿงช

mobile-testing

์•ˆ์ „ ๐ŸŒ ๋„คํŠธ์›Œํฌ ์ ‘๊ทผ๐Ÿ“ ํŒŒ์ผ ์‹œ์Šคํ…œ ์•ก์„ธ์Šคโš™๏ธ ์™ธ๋ถ€ ๋ช…๋ น์–ด

Test React Native apps with Jest

Writing tests for React Native applications is time-consuming without proper templates and patterns. This skill provides ready-to-use testing templates for components, hooks, and utilities along with mocking patterns and best practices.

์ง€์›: Claude Codex Code(CC)
๐Ÿ“Š 71 ์ ์ ˆํ•จ
1

์Šคํ‚ฌ ZIP ๋‹ค์šด๋กœ๋“œ

2

Claude์—์„œ ์—…๋กœ๋“œ

์„ค์ • โ†’ ๊ธฐ๋Šฅ โ†’ ์Šคํ‚ฌ โ†’ ์Šคํ‚ฌ ์—…๋กœ๋“œ๋กœ ์ด๋™

3

ํ† ๊ธ€์„ ์ผœ๊ณ  ์‚ฌ์šฉ ์‹œ์ž‘

ํ…Œ์ŠคํŠธํ•ด ๋ณด๊ธฐ

"mobile-testing" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Write a test for a LoginForm component that validates email input

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Import render and fireEvent from testing library
  • Render LoginForm with testID props for reliable selection
  • Use fireEvent.changeText to simulate user input
  • Use fireEvent.press to trigger form submission
  • Assert that error messages appear for invalid input
  • Verify form validation logic works correctly

"mobile-testing" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. How do I test a custom hook that fetches data?

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Use renderHook to render the hook with initial props
  • Use act to wrap state updates from the hook
  • Use findBy queries to wait for async content
  • Assert the rendered output matches expected data
  • Test loading and error states as well

"mobile-testing" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Create a test for a list component that renders items

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Create mock data array with test items
  • Render list component with mock items
  • Use getAllByTestId to find all rendered items
  • Assert the correct number of items are rendered
  • Verify item content matches mock data

๋ณด์•ˆ ๊ฐ์‚ฌ

์•ˆ์ „
v5 โ€ข 1/16/2026

Pure documentation skill containing only markdown templates and guidance for React Native testing. No executable code, network operations, or file system operations beyond reading its own content. Static findings are false positives from the scanner misinterpreting documentation code blocks and metadata as executable security risks.

2
์Šค์บ”๋œ ํŒŒ์ผ
376
๋ถ„์„๋œ ์ค„ ์ˆ˜
3
๋ฐœ๊ฒฌ ์‚ฌํ•ญ
5
์ด ๊ฐ์‚ฌ ์ˆ˜

ํ’ˆ์งˆ ์ ์ˆ˜

38
์•„ํ‚คํ…์ฒ˜
100
์œ ์ง€๋ณด์ˆ˜์„ฑ
85
์ฝ˜ํ…์ธ 
30
์ปค๋ฎค๋‹ˆํ‹ฐ
100
๋ณด์•ˆ
91
์‚ฌ์–‘ ์ค€์ˆ˜

๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ฒƒ

Writing unit tests

Get templates for testing components, hooks, and utility functions in React Native apps

Creating integration tests

Set up integration tests for features with proper mocking of external dependencies

Improving test coverage

Follow best practices to increase test coverage with isolated, maintainable tests

์ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉํ•ด ๋ณด์„ธ์š”

Component test
Write a Jest test for MyButton component that renders correctly and calls onPress when pressed
Hook test
Write a test for useCounter hook that increments and decrements the count value
Mock external
Show me how to mock the database module in Jest tests for a React Native app
Async test
Write an async test that waits for data to load and verifies the rendered content

๋ชจ๋ฒ” ์‚ฌ๋ก€

  • Test user-facing behavior instead of internal implementation details
  • Use testID props for element selection instead of fragile text queries
  • Mock external dependencies to keep tests fast and isolated

ํ”ผํ•˜๊ธฐ

  • Testing implementation details instead of user behavior
  • Using text queries that break with UI changes
  • Skipping mocking of external services causing flaky tests

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

Which React Native versions are supported?
Works with React Native 0.70+ and Expo SDK 50+. Compatible with Jest 28+ and React Native Testing Library.
What is the maximum test file size?
No enforced limit. Keep tests focused with one concern per file. Large components may need multiple test files.
Can this skill integrate with CI/CD pipelines?
The skill provides guidance for running Jest in CI. Add npm test to your CI pipeline configuration.
Is test data stored securely?
Tests run locally. No test data leaves your machine. Jest stores coverage reports locally by default.
Why are my tests timing out?
Increase Jest timeout, check for unresolved promises, use waitFor or findBy queries for async content.
How is this different from Detox for E2E testing?
Jest with RNTL tests units and components in isolation. Detox tests full app flow on simulator. Use both together.

๊ฐœ๋ฐœ์ž ์„ธ๋ถ€ ์ •๋ณด

์ž‘์„ฑ์ž

BabakBar

๋ผ์ด์„ ์Šค

MIT

์ฐธ์กฐ

main

ํŒŒ์ผ ๊ตฌ์กฐ

๐Ÿ“„ SKILL.md