Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

testing

/testing

Podaje wskazówki do testów React Native: logiki, zachowania komponentów, ścieżek krytycznych E2E i przypadków brzegowych.

Licencja
MIT
Ostatnia zmiana repozytorium
29.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 29.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Podaje wskazówki do testów React Native: logiki, zachowania komponentów, ścieżek krytycznych E2E i przypadków brzegowych.

Oryginalny opis (EN)

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.

Jak działa

  1. Applicability
  2. When to Use
  3. Severity
  4. Guidance
  5. Pitfalls
Sekcje z nagłówków SKILL.md, w oryginale · 69 linii, 410 słów
Podgląd SKILL.md
---
name: testing
description: 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.
version: 1.2.0
platforms: [ios, android]
react-native-version: 0.76+
tags: [react-native, testing, quality]
---

# 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:**
```tsx
expect(component.find('useFetchUsers')).toHaveBeenCalled();
```

**Correct:**
```tsx
render(<UserList />);
expect(await screen.findByText('Ada Lovelace')).toBeOnTheScreen();
```

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

**Correct:**
```tsx
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.

Wersje

RepozytoriumWynikLicencja
Ta strona · neha/rn-developer-skills100MIT
iuliandita/skills100MIT
wrongstack/wrongstack100MIT
langwatch/langwatch100Apache-2.0
mcouthon/agents100MIT
nteract/nteract100BSD-3-Clause
kettleofketchup/DraftForge100GPL-3.0
skillberry-ai/cap-evolve100Apache-2.0
TheBeardedBearSAS/claude-craft100MIT

Migawka bazy z 13.11.2026 · wersja paczki e41cb3fee05a (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-native-testing
    Testuje komponenty React Native z Jest i React Native Testing Library.
  • 90testing-react
    Wyznacza strategię testów dla aplikacji React 19.3 i React Compiler 1.0: pisanie testów, ocena pokrycia i konfiguracja testów.
  • 100webapp-testing
    Podpowiada wzorce testów E2E w Playwright i testów komponentów Testing Library oraz selektory dla aplikacji Next.js lub React.
  • 100react-native-web-testing
    Wspiera testowanie aplikacji React Native Web z Jest i React Native Testing Library, w tym testy komponentów i strategie dla sieci.
  • 100bugmagnet
    Wykrywa błędy i luki w pokryciu testami modułu kodu, pisze testy przypadków brzegowych i prowadzi testy eksploracyjne wskazanego pliku.
  • 100writing-tests
    Pisze testy jednostkowe i komponentów dla AiderDesk w Vitest i React Testing Library, wraz z konfiguracją mocków.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.