Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

flutter-testing

/flutter-testing

Sprawdza pracę we Flutter analizatorem i testami: jednostkowymi, bloc, widgetowymi i golden, zgodnie z narzędziami projektu.

Licencja
MIT
Ostatnia zmiana repozytorium
09.11.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 09.11.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

Sprawdza pracę we Flutter analizatorem i testami: jednostkowymi, bloc, widgetowymi i golden, zgodnie z narzędziami projektu.

Oryginalny opis (EN)

How to verify Flutter work - analyzer, unit, bloc/notifier, widget, and golden tests, using the project's existing test tooling. Use when fixing a bug, adding a feature that has testable logic, writing or repairing tests, or before claiming a Flutter task is done.

Jak działa

  1. The verification loop (always)
  2. Use what the project already has
  3. Bug fixes: reproduce first
  4. What to test where
  5. Don'ts
Sekcje z nagłówków SKILL.md, w oryginale · 59 linii, 420 słów
Podgląd SKILL.md
---
name: flutter-testing
description: How to verify Flutter work - analyzer, unit, bloc/notifier, widget, and golden tests, using the project's existing test tooling. Use when fixing a bug, adding a feature that has testable logic, writing or repairing tests, or before claiming a Flutter task is done.
license: MIT
---

# Flutter testing & verification

## The verification loop (always)

Use `fvm flutter` / `fvm dart` if the project has `.fvmrc`.

```
1. dart format <changed files>
2. flutter analyze                       → zero new errors/warnings
3. dart run build_runner build -d         (only if annotated code changed)
4. flutter test <relevant test files>     → green
```

Report results honestly: which commands ran, what passed, what failed, what you couldn't run.

## Use what the project already has

Check `dev_dependencies` before writing a test:

| If present | Use it for |
|---|---|
| `bloc_test` | `blocTest<MyCubit, MyState>(build:, act:, expect:)` |
| `mocktail` | `class MockRepo extends Mock implements Repo {}` + `when(() => ...)`, `registerFallbackValue` for custom args |
| `mockito` | `@GenerateMocks([...])` + build_runner — don't mix with mocktail |
| `golden_toolkit` / `alchemist` | golden tests in the project's existing style |
| `integration_test` / `patrol` | end-to-end flows |
| nothing | plain `flutter_test` with hand-written fakes |

Don't add a new test package without asking. Put tests in `test/` mirroring `lib/` paths
(`lib/features/auth/auth_cubit.dart` → `test/features/auth/auth_cubit_test.dart`), or follow the existing layout.

## Bug fixes: reproduce first
1. Write the smallest test that fails because of the bug.
2. Run it — confirm it fails for the right reason.
3. Fix the code.
4. Run it again — confirm it passes, plus neighbouring tests.

If the bug is untestable in the current structure (e.g. logic buried in a widget), say so and propose the
minimal change — don't restructure silently.

## What to test where
- **Unit**: models (`fromJson` with a real API sample, including missing/null fields), mappers, validators, utils.
- **Bloc / Cubit / Notifier**: each event/method → expected sequence of states, including the error path.
  Mock repositories, not HTTP.
- **Widget**: rendering for each state (loading / data / empty / error), key interactions, navigation trigger.
  - Wrap with what the widget needs: `MaterialApp`, localization delegates, `BlocProvider.value(value: mockCubit)`,
    `ProviderScope(overrides:)`, `ScreenUtilInit` — copy from an existing widget test or a shared `pumpApp` helper.
  - `await tester.pumpAndSettle()` hangs on infinite animations (progress indicators) — use `pump(duration)` there.
  - Find by `Key` or semantic text; avoid `find.byType` for generic widgets.
- **RTL**: for layout-sensitive widgets, also pump with `Directionality(textDirection: TextDirection.rtl)`
  or the Arabic locale.

## Don'ts
- Don't make tests pass by loosening assertions, adding `skip:`, or deleting tests.
- Don't hit real network/Firebase in unit/widget tests.
- Don't commit golden files generated on a different platform than CI uses without saying so.
- Don't leave `print` / `debugPrint` in tests.

Wersje

RepozytoriumWynikLicencja
Ta strona · moustafadev/flutter-ai-skills100MIT
HoangNguyen0403/agent-skills-standard100MIT
Dee9975/cc-skills-flutter100MIT
Albaylar/Mobile-Development-Kit100MIT
testland/qa100MIT
abdukabirov/flutter-agent-skills100MIT
thiennc-tesoglobal/flutter-skills100BSD-3-Clause
ethiel97/flutter-clean-riverpod-skills100MIT
jyotiraditya-chauhan/test-kit100MIT

Migawka bazy z 13.11.2026 · wersja paczki 88a455e5c961 (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

  • 100testing
    Pomaga pisać i recenzować testy we Flutter i Dart: jednostkowe, widżetów i golden, naprawiać niestabilne testy, dodawać pokrycie i wybierać między testami jednostkowymi a widżetów.
  • 95testing-flutter
    Pomaga pisać testy i strategię testowania aplikacji Flutter 3.47 z BLoC v9 i Riverpod 3.
  • 95flutter-expertise
    Buduje i przegląda aplikacje Flutter: strukturę, zarządzanie stanem, nawigację, wydajność przebudowań, testy i wydania.
  • 85flutter-core:flutter-testing-quality
    Pisze testy aplikacji Flutter: jednostkowe, widgetów, integracyjne i golden, z mockami, pokryciem i profilowaniem w DevTools.
  • 100flutter-bloc-state-management
    Wdraża stan, zdarzenia, przejścia i współbieżność asynchroniczną w BLoC i Cubit we Flutterze, w tym zdarzenia z debounce, anulowalne i testy bloc.
  • 100flutter-feature
    Dodaje funkcję, ekran lub formularz do istniejącej aplikacji Flutter zgodnie z jej konwencjami i sprawdza analizatorem.

Uwagi i zgłoszenia

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