Index of every page on this site: llms.txt
All skills
neha avatar

/testing

@eb9f097
Run it yourself

Guidance for testing React Native code — unit tests for logic, component tests for behaviour, E2E for critical paths, and edge-case coverage. Use when adding tests, reviewing test quality, or setting a coverage bar.

Use this Skill: https://skilld.dev/gh/neha/rn-developer-skills/testing

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈57 tokens for metadata: the name and description. ≈654 when used: this file.

Description uses 2.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈225 characters, or 2.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Testing Skill

Applicability

  • Platforms: iOS and Android
  • React Native: 0.76+ (New Architecture interop assumed unless a checklist item says otherwise)

When to Use

  • Adding tests for a new feature, hook, or utility
  • Reviewing whether a change is adequately tested before merge
  • Deciding what to test and at which level
  • Investigating a regression that tests should have caught

Severity

A missing test is should-fix. It blocks a merge only when the project's own policy says so.

Guidance

What to Test

A critical path is a flow the user cannot finish the job without: sign-in, pay, or the submit this change adds. Cover that path. Do not require an end-to-end test for a colour or copy tweak.

  • Unit tests for hooks and utility functions
  • Component tests for user-facing behaviour, not implementation details
  • An end-to-end test for the critical path this change affects, where the project already has an end-to-end runner
  • Edge cases the screen can actually hit: empty data, error, permission denied, offline, and a killed app if the feature must survive one

How to Test

  • Mocks sit at the boundary (network, native module), not around the screen's own hooks
  • A native module mock returns the statuses the screen handles, including denied and unavailable
  • No snapshot tests as a primary assertion (brittle, low signal)
  • Tests assert observable behaviour and outputs, not internal calls
  • Each test is independent and does not rely on execution order

Incorrect:

expect(component.find('useFetchUsers')).toHaveBeenCalled();

Correct:

render(<UserList />);
expect(await screen.findByText('Ada Lovelace')).toBeOnTheScreen();

Incorrect:

jest.mock('camera', () => ({ request: () => 'granted' }));

Correct:

jest.mock('camera', () => ({ request: () => 'denied' }));
render(<ScanScreen />);
expect(await screen.findByText('Camera access is off')).toBeOnTheScreen();

Pitfalls

  • Snapshot tests fail on every harmless markup change, training the team to update them without reading — they catch little and erode trust.
  • Over-mocking produces tests that pass while the real integration is broken; mock only what you must (network, native modules).
  • Testing implementation details (which hook ran, internal state) makes refactoring painful even when behaviour is unchanged.
  • A native mock that only returns success hides the denied and unavailable branches users hit.
  • Skipping a killed-app case leaves persistence untested for features that claim to survive a restart.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill provides best practices and guidance for testing React Native applications. It is purely instructional and contains no executable code, remote dependencies, or security risks.

  • Socket15d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at eb9f097. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 2 months ago
version
1.2.0
platforms
[
  "ios",
  "android"
]
react-native-version
0.76+
Other metadata
tags
[
  "react-native",
  "testing",
  "quality"
]

README badge

README badge for neha/rn-developer-skills/testing