MetaMask / MetaMask/contributor-docs

Add guidelines about when and how to use snapshot tests effectively

Aperta Adatta ai principianti
#115 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

category-documentation github-migration-triaged team-wallet-framework wf-documentation
Lingua principale
JavaScript
Stelle
86
Fork
42
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Snapshot tests are often "misused" to create hard-to-understand and brittle tests that are not effective at catching bugs. They can be useful in narrow situations though.

We should write guidance about when and how to effectively use snapshot tests.

There is some mention of snapshot testing here already: https://github.com/MetaMask/contributor-docs/blob/main/docs/testing/unit-testing.md#snapshots
But it doesn't provide enough guidance yet.

References for inspiration:
* https://x.com/searls/status/919594505938112512
* https://www.youtube.com/watch?v=Af4M8GMoxi4

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start with docs/testing/unit-testing.md and its existing Snapshots section. Review the linked references for useful principles, then expand the documentation with guidance on when snapshots are appropriate and how to keep them understandable and effective. Done means the section clearly addresses both appropriate use and common misuse.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
documentation, testing
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.