`examples` for property tests
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- testing
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 21 h 22 min
- PR fusionados (30 d)
- 486
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Effect-TS/effect
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing componentsPosiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#11097 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`Posiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#11096 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
check:failed streams:edit
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
iptv-org/iptv#60585 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsPosiblemente ocupada @Piyush4801 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jaegertracing/jaeger-ui#4865 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día