unit-testing
/unit-testing
Podpowiada, jak uruchamiać i pisać testy jednostkowe w Vitest w tym workspace, z plikami .spec.ts i mockami natywnych globali.
- Autor
- nativescript ↗
- Repozytorium
- nativescript ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 24.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 24.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Podpowiada, jak uruchamiać i pisać testy jednostkowe w Vitest w tym workspace, z plikami .spec.ts i mockami natywnych globali.
Oryginalny opis (EN)
How to run and write unit tests in this workspace (Vitest, colocated .spec.ts files, mocked native globals). Use when writing, changing, or running tests.
Jak działa
- Running
- Writing
- Environment Constraints
Podgląd SKILL.md
--- name: unit-testing description: How to run and write unit tests in this workspace (Vitest, colocated .spec.ts files, mocked native globals). Use when writing, changing, or running tests. --- # Unit Testing Tests are `*.spec.ts` files colocated with the source they cover, written with Vitest and run per package through Nx. See [WritingUnitTests.md](./references/WritingUnitTests.md) for the full guide. ## Running ```bash npx nx run core:test # all core tests npx nx run core:test -t 'Name' # isolate by describe/it name npx nx run core:test --watch # watch mode ``` Use `-t` to run only the tests related to your change first; run the full package target before finishing. ## Writing - Use the standard Vitest API (`describe`, `it`, `expect`, `beforeEach`, `vi`). Globals are enabled, so imports from `vitest` are optional — match the style of neighboring specs. - Place the spec next to the module: `packages/core/xml/index.spec.ts` covers `packages/core/xml/index.ts`. - Every behavior change in shared (non-platform-specific) logic should add or extend a spec. ## Environment Constraints - Tests run in Node, not on a device. `packages/core/vitest.setup.ts` stubs the platform globals (`__IOS__`, `__ANDROID__`, minimal `NSObject`-style mocks) so modules can load — real iOS/Android APIs do NOT exist here. - If a test needs more native surface, extend the mocks in `vitest.setup.ts`; do not stub natives inline per spec. - Behavior that depends on the real native runtime cannot be unit tested — it belongs in the `apps/automated` e2e suite, which requires a simulator/emulator. Do not attempt to run it unless explicitly asked. - Keep tests deterministic: no network calls, no timing-sensitive assertions without fake timers (`vi.useFakeTimers()`).
Pliki w paczce (2)
- SKILL.md 2 KB
- references/WritingUnitTests.md 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · nativescript/nativescript | 100 | MIT |
| MARUCIE/openclaw-foundry | 95 | MIT |
| Tyler-R-Kendrick/agent-skills | 95 | MIT |
| kid-sid/codex-spellbook | 95 | MIT |
| OKHP3/skillz | 90 | MIT |
| rnavarych/alpha-engineer | 90 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki 7be5c1fa5e0e (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
- 100frontend-testing
Generuje testy Vitest i React Testing Library dla komponentów, hooków i funkcji pomocniczych we frontendzie, w tym pliki spec, pokrycie kodu oraz testy jednostkowe i integracyjne. - 90Vitest
Pomaga pisać testy w Vitest dla aplikacji opartych na Vite: jednostkowe i integracyjne, mocki, pokrycie, React Testing Library i testy TypeScript. - 100frontend-testing
Generuje testy Vitest i React Testing Library dla komponentów, hooków i funkcji pomocniczych frontendu Dify, w tym pliki spec, pokrycie kodu oraz testy jednostkowe i integracyjne. - 100typescript-testing
Pisze testy TypeScript w Jest lub Vitest: testy jednostkowe i integracyjne, mocki oraz pokrycie kodu. - 100vitest-testing-patterns
Pisze testy w Vitest i React Testing Library: testy jednostkowe, komponentów i integracyjne, mockowanie zależności, pokrycie i dobre praktyki. - 100vitest-testing-patterns
Pisze testy w Vitest i React Testing Library: testy jednostkowe, komponentów i integracyjne, mockowanie zależności, pokrycie i dobre praktyki.