Pular para o conteúdo
Kitbay
Skill

testing

NOASSERTIONAtualizado em 11 de nov. de 202684.974Estrelas no GitHub

A maintainer skill in the LobeHub repository for writing and fixing Vitest tests across its web app, packages and Electron desktop app.

O que a skill ensina

A maintainer skill in the LobeHub repository for writing and fixing Vitest tests across its web app, packages and Electron desktop app. It prefers spies over module mocks and asks for spies to be restored, tests behaviour rather than wiring, requires a regression test that fails without each bug fix, and says to move complex component logic into hooks instead of adding component tests. For failing tests it explains which to fix and which to delete. It gives the command for running a single file, with the database package run against PGlite or a real Postgres, warns against running the full suite of over 3,000 tests, and requires tests for every new database model or repository.

O que faz

  • Write Vitest tests with spies and boundary mocks
  • Decide whether to fix or delete a failing test
  • Run one test file against PGlite or Postgres
  • Add tests for new database models