Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

write-tests

/write-tests

Pisze, poprawia i przegląda testy w tym repozytorium, zgodnie z jego standardem jakości i właściwymi pomocnikami.

Repozytorium
todoist-cli ↗
Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

90/ 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ść25 / 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
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.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

Pisze, poprawia i przegląda testy w tym repozytorium, zgodnie z jego standardem jakości i właściwymi pomocnikami.

Wyzwalacze z opisu

needs a test
Oryginalny opis (EN)

Writes or changes tests in this repository to its quality bar, with the right helpers and layer. Use when adding, fixing or reviewing tests, when a change "needs a test", or when deciding whether a test may change.

Jak działa

  1. Where tests live
  2. Helpers
  3. The quality bar
  4. When an existing test may change
Sekcje z nagłówków SKILL.md, w oryginale · 27 linii, 309 słów
Podgląd SKILL.md
---
name: write-tests
description: Writes or changes tests in this repository to its quality bar, with the right helpers and layer. Use when adding, fixing or reviewing tests, when a change "needs a test", or when deciding whether a test may change.
---

# Write tests

## Where tests live

- Next to the code: `src/lib/refs.ts` → `src/lib/refs.test.ts`. A command group has one test file for the group or one per subcommand (`src/commands/label/label.test.ts`, `src/commands/project/reorder.test.ts`). Vitest, globals on, `restoreMocks: true`, so spies restore themselves: no manual `.mockRestore()`.
- Command tests mock the SDK client: `vi.mock('../../lib/api/core.js', () => ({ getApi: vi.fn() }))` at the top, `mockApi = setupApiMock()` in `beforeEach`, a program from `createTestProgram(registerXxxCommand)`, then `program.parseAsync(['node', 'td', ...])`. Capture output with `captureConsole()` or `captureStream()`. Read `src/commands/label/label.test.ts` for the shape.
- `src/index.integration.test.ts` builds the CLI and runs `dist/index.js`, for argv handling, global flags and JSON errors end to end.
- `vi.mock('chalk')` uses the manual mock in `src/__mocks__/chalk.ts`, which makes styling a passthrough so tests read plain text.
- Agent tooling tests live in `.agents/scripts/` and run copies of the tools in throwaway repos (`.agents/scripts/lib/test-repo.ts`).

## Helpers

From `src/test-support/`: `createMockApi`, `setupApiMock`, `fixtures`, `makeFilter`, `createProjectProgram`. From `@todoist/cli-core/testing`: `createTestProgram`, `captureConsole`, `captureStream`, `describeEmptyMachineOutput`. Build entities from `fixtures` instead of by hand; extend it when a test needs a new shape.

## The quality bar

Read [references/test-rules.md](references/test-rules.md) before writing or reviewing a test. In short: a test counts only if it can fail. It asserts outcomes, takes expected values from outside the code under test, mocks only real boundaries, and you saw it fail once.

Done when each new test has failed once for the right reason, and then passes.

## When an existing test may change

- **The behaviour changed on purpose** (a feature or a fix): change the assertions that describe it, and say which in the report.
- **A refactor:** only how the test reaches the code (imports, names, call sites). Never its inputs or assertions, including expected output strings.
- **Never** to make a failing check pass without a behaviour change: no `.skip`, no deleted test, no looser matcher (`toEqual` → `toMatchObject`, exact arguments → `toHaveBeenCalled()`).
Pliki w paczce (2)
  • SKILL.md 3 KB
  • references/test-rules.md 6 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · doist/todoist-cli90MIT
onsi/biloba100MIT
runwield/runwield100MIT
dzhng/jevgrep100MIT
lukedj78/dev-flow100MIT
dzhng/skills100MIT
rowansci/rowan-python100MIT
yaohuangguan/agent-playbook100MIT
microsoft/semantic-link-labs100MIT

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

  • 100review
    Przegląda testy Playwright pod kątem jakości i dobrych praktyk.
  • 100review
    Przegląda testy Playwright pod kątem jakości i dobrych praktyk.
  • 100v1-write-tests
    Pisze testy jednostkowe do zmian w kodzie i nowej funkcjonalności, zanim trafią do przeglądu.
  • 100writing-tests
    Pisze deterministyczne testy, które wykrywają realne błędy produktu, i pomaga naprawiać niestabilne testy.
  • 100write-clean-tests
    Pisze i przegląda testy zgodnie z zasadami F.I.R.S.T., z jednym pojęciem w teście, pokryciem stanów i testem regresji dla każdej poprawki.
  • 95test-quality
    Pisze testy w JUnit 5 z asercjami AssertJ, dodaje brakujące przypadki i poprawia pokrycie kodu Javy.

Uwagi i zgłoszenia

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