unit-test
/unit-test
Pisze izolowane testy jednostkowe dla wskazanego pliku w schemacie Arrange-Act-Assert.
- Autor
- mrlemoos ↗
- Repozytorium
- galicia ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 10.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 10.11.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
Pisze izolowane testy jednostkowe dla wskazanego pliku w schemacie Arrange-Act-Assert.
Oryginalny opis (EN)
Writes isolated unit tests for a named file using Arrange-Act-Assert. Use when user requests unit tests, test coverage, or missing test cases for a file.
Jak działa
SKILL.md bez nagłówków drugiego poziomu · 24 linii, 398 słów
Podgląd SKILL.md
--- name: unit-test description: Writes isolated unit tests for a named file using Arrange-Act-Assert. Use when user requests unit tests, test coverage, or missing test cases for a file. --- # Unit test Short evidence, no emojis. No target file named: reply "Please mention the file that you want me to help you write the unit tests for." and stop. Sphere: one function, class, or component; most isolated of three. Cross-layer data flow belongs in behavioural-test; full user journey in e2e-test. Case fits another sphere: say so, do not write it here. 1. Read target file, its direct collaborators, nearest existing unit tests. Reuse project's runner, assertion library, file naming, test location, helpers, mock style. No existing tests: use runner in project config; none configured: ask user, add no dependency without approval. 2. List cases before writing: every exported function/method, each branch, boundary values (empty, zero, one, max, null/undefined), invalid input, thrown/rejected errors, async ordering. Unreachable or untestable case: state why, do not fake coverage. 3. Write tests. Rules: - Arrange-Act-Assert: three blocks in that order, blank line between. Label with `// Arrange`, `// Act`, `// Assert` only if project tests already do. One Act per test. - One behaviour per test. Several asserts allowed only when they describe same outcome. - Name states unit, condition, expected result. Group by unit under test. - Test public behaviour, not private internals or call order, unless call itself is contract. - Mock every collaborator outside unit: network, filesystem, clock, randomness, environment, other modules with side effects. Pure helpers stay real. Pin time and randomness. Never mock unit under test. - Independent tests: no shared mutable state, no order dependence, reset mocks between tests. Setup hooks only for identical Arrange. - No logic in tests: no loops, conditionals, or recomputing expected value with production algorithm. Literal expected values. Table-driven cases allowed when runner supports them. - Assert specific value or error type/message, not merely truthy or "did not throw". - No fixed sleeps; await condition or use fake timers. - Do not change production code to make tests pass. Suspected bug: keep failing test, report to user, ask before fixing. 4. Run new tests alone; show invocation + result. Failure: decide whether test or code wrong, fix test only when test wrong. Rerun until green. 5. Run project lint and type checks on test file; fix every error. Run full relevant suite; new tests must not break others. 6. Repeat 4-5 after each edit. Report cases covered, cases skipped with reason, suspected bugs, commands run. Never claim passing without run output.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · mrlemoos/galicia | 86 | MIT |
| moveju112/skill_verify | 100 | MIT |
| illiaKvanette/menta-lesson-planner | 86 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki a86259b7f107 (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
- 90unit-test-design
Pomaga pisać testy jednostkowe, które dokumentują zachowanie przez jawne fazy arrange-act-assert i jedną asercję intencji. - 100testing
Projektuje skuteczne testy: jednostkowe czy integracyjne, przypadki brzegowe, układ arrange-act-assert i minimalny test błędu przed poprawką. - 100unit-testing-principles-aaa-pattern
Układa czytelne, deterministyczne testy jednostkowe według wzorca Arrange-Act-Assert i dba o higienę asercji. - 95tdd
Przypomina zasady TDD: cykl czerwony, zielony, refaktoryzacja, zasady FIRST oraz strukturę Arrange-Act-Assert. - 100test-unit
Pisze testy jednostkowe i integracyjne dla wskazanego modułu lub zmiany, na przykład dla pojedynczej funkcji. - 84tdd-assistant
Opisuje cykl czerwony-zielony-refaktoryzacja, zasady FIRST i strukturę Arrange-Act-Assert dla testów pisanych przed kodem.