Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

flaky-tests

/flaky-tests

Diagnozuje i zapobiega niestabilnym testom Biloba w TypeScript i Vitest: zbędne pętle ponowień, optymistyczny UI, asynchroniczny layout, handlery sieciowe i UI sterowany timerami przez zegar strony.

Repozytorium
biloba ↗
Licencja
MIT
Ostatnia zmiana repozytorium
27.10.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
1
Przestarzałość

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

Diagnozuje i zapobiega niestabilnym testom Biloba w TypeScript i Vitest: zbędne pętle ponowień, optymistyczny UI, asynchroniczny layout, handlery sieciowe i UI sterowany timerami przez zegar strony.

Oryginalny opis (EN)

Diagnose and prevent flaky Biloba TypeScript/Vitest tests — redundant client-side retry loops, immediate mode, single-shot evaluate reads, optimistic UI, async layout, first-match-wins network handlers, held responses, vacuous assertions, visual update/tolerance hazards, lifecycle leakage, and timer-driven UI (debounces, countdowns, expiries) taken off real time with the page clock, including why polling never advances a paused clock. Use when a Biloba Vitest test is intermittent, order-dependent, load-sensitive, or only fails in CI/parallel workers.

Jak działa

  1. Common residual races
  2. Visual traps
Sekcje z nagłówków SKILL.md, w oryginale · 35 linii, 422 słów
Podgląd SKILL.md
---
name: flaky-tests
description: Diagnose and prevent flaky Biloba TypeScript/Vitest tests — redundant client-side retry loops, immediate mode, single-shot evaluate reads, optimistic UI, async layout, first-match-wins network handlers, held responses, vacuous assertions, visual update/tolerance hazards, lifecycle leakage, and timer-driven UI (debounces, countdowns, expiries) taken off real time with the page clock, including why polling never advances a paused clock. Use when a Biloba Vitest test is intermittent, order-dependent, load-sensitive, or only fails in CI/parallel workers.
---

# Flaky Biloba Vitest tests

Biloba actions and assertions already poll inside `bilobad`. Start by deleting outer retries:

```ts
// Good: one request; the daemon owns the retry loop.
await session.getByRole("button", {name: "Save"}).click({timeoutMs: 5_000});
await session.getByTestId("status").expectText("Saved");
```

Do not wrap these calls in `expect.poll`, `waitFor`, sleeps, or a loop. Outer polling hides the useful inner failure and adds a process round trip per attempt. Avoid `{mode: "immediate"}` and `{immediate: true}` unless the test genuinely requires a single observation.

## Common residual races

- **Single-shot application reads:** `evaluate()` reads once. Poll with `expectEvaluation()` when the value must become true.
- **Gate then re-read:** use the `AssertionResult.observed` value from the successful assertion when available instead of taking a second page read.
- **Optimistic UI:** a changed DOM proves the click handler ran, not that the renderer applied the server response. Poll a lazily-written application-state marker or control response arrival with `holdResponse()`.
- **Async geometry:** existence does not imply settled layout. Use Biloba's geometry/style assertions rather than one-shot `getBoundingClientRect()` evaluation.
- **Network shadowing:** handlers are ordered and first-match-wins. Inspect `count()`, `stats()`, or `networkShadowDiagnostics()` to prove the intended handler fired; remove handlers when their scope ends.
- **Held responses:** always release in `finally`. A leaked hold makes the next failure look unrelated.
- **Lifecycle leakage:** reuse one root session but call `prepare()` before every test, and close worker browsers in `afterAll`.
- **Vacuous negatives:** anchor scopes and assert expected counts before negative collection assertions so an empty selection cannot pass accidentally.
- **Real timers:** a test that waits for the page's own `setTimeout` (a debounce, a toast that hides after 3s, a countdown, a session expiry) is slow when it works and flaky when the timer races the poll deadline. Don't widen the timeout: `installClock(t0)` before `navigate()`, `pauseAt(t0)`, then `runFor(ms)` or `fastForward(ms)` (`biloba-vitest:write-tests` §8).
- **A paused clock:** polling never advances it. A timeout ending in `This tab's page clock is paused at <t>; ...` means the page's timers never ran — call `runFor`, `fastForward`, or `resume` before the assertion.

## Visual traps

- A missing baseline must fail until a human reviews and writes it.
- Never enable screenshot update mode (`BILOBA_UPDATE_SCREENSHOTS`, `updateScreenshots`) in CI.
- Mask deterministic dynamic regions; do not widen tolerances until the assertion cannot fail.
- Treat byte-identical light/dark captures as suspicious when the test intended two schemes.

On failure, read `BilobaError.trajectory` before increasing timeouts. Flat means waiting longer will not help. Artifacts → `biloba-vitest:debug-failures`. Measuring a flake's rate, or confirming a fix → `biloba-vitest:flake-hunt`. Visual workflow → `biloba-vitest:visual-assertions`. Docs: <https://onsi.github.io/biloba/vitest.html>.

Wersje

RepozytoriumWynikLicencja
Ta strona · onsi/biloba100MIT
ShepardVasNormandy/claude-skills100MIT

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

  • 100write-tests
    Pisze testy przeglądarkowe Biloba w TypeScript i Vitest: sesje, karty, ramki, lokatory, asercje, zegar strony i zrzuty ekranu.
  • 87flaky-specs
    Diagnozuje i zapobiega niestabilnym specyfikacjom Go/Ginkgo Biloba, które przechodzą lokalnie, a w CI padają losowo.
  • 90reliable-tests
    Diagnozuje, naprawia i zapobiega niestabilnym testom, głównie przez czasy, wspólny stan i różnice Windows.
  • 90vitest-guide
    Pomaga pisać testy w Vitest 3 w TypeScript: mocki, asercje HTTP, testy CORS i poprawność typów w testach.
  • 100vitest-runner
    Uruchamia testy JavaScript i TypeScript w Vitest z pokryciem, trybem watch i wykonaniem równoległym.
  • 100typescript-testing
    Pisze testy TypeScript w Jest lub Vitest: testy jednostkowe i integracyjne, mocki oraz pokrycie kodu.

Uwagi i zgłoszenia

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