`examples` for property tests
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Start by locating CheckOptions and the implementations of it.prop and it.effect.prop, then trace how generated cases are checked. Add support for running supplied examples before generated cases, and consider how named examples appear in failures. Done when examples are checked by all three APIs and the behavior is covered by tests; the issue names no files or tests, so first map the relevant test entry points.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is the problem this feature would solve?
fast-check's examples parameter runs known inputs before the generated ones. When migrating property tests from fast-check to Arbitrary and @effect/vitest's it.prop, there's no equivalent in CheckOptions or the it.prop options.
We use examples heavily (several hundred tests) for edge cases and regression inputs that sit alongside the generated ones. Without it, each one becomes a separate it.each sharing the property's assertion:
const property = (events: ReadonlyArray<Event>, id: Id) => {
expect(foldState(events, id)).toStrictEqual(new NotStarted())
}
it.prop("generated", [Schema.Array(Event), Id], ([events, id]) => property(events, id))
it.each([
["no events", [], id1],
["events for another review", [started], id2],
])("%s", (_name, events, id) => property(events, id))
What is the feature you are proposing to solve the problem?
An examples option on CheckOptions, and so on it.prop and it.effect.prop, that checks the given inputs before generated ones:
it.prop("not started", [Schema.Array(Event), Id], ([events, id]) => property(events, id), {
arbitrary: {
examples: [
[[], id1],
[[started], id2],
],
},
})
Ideally an example could have a name, shown in the output when it fails, for example { name: "events for another review", value: [[started], id2] }. That would improve on fast-check, where we keep the names in comments.
What alternatives have you considered?
it.each alongside each property, as above. It works but doubles the boilerplate. It also separates the examples from the property they belong to, so they aren't shrunk or replayed with it.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 21h 22m
- PR unite (30g)
- 486
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing componentsForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11097 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`Forse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11096 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
check:failed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
iptv-org/iptv#60585 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsForse già presa @Piyush4801 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jaegertracing/jaeger-ui#4865 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno