Support Effects in vitest setup hooks (Reopened from V3)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- testing
Línea de trabajo
Start by inspecting the @effect/vitest hook exports and its existing Effect runner, then compare the supported Vitest hooks with the requested before, after, and around variants. Done means Effect callbacks run through the runner with the outer it.layer available, while synchronous and Promise-returning callbacks remain unchanged. Add regression coverage for suite-level and per-test hooks, including the concurrent test configuration.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What is the problem this feature would solve?
This is the same as #6096, but for V4. Credit to @dmeehan1968 and @coyaSONG
Paste the original FR here:
Description
@effect/vitest currently re-exports Vitest's beforeAll and beforeEach hooks unchanged. Vitest does not recognize a returned Effect as asynchronous work, so the Effect remains lazy and the hook body is skipped.
This change explicitly wraps both hooks. When a callback returns an Effect, it is executed and awaited through the package's existing Effect runner; synchronous and Promise-returning callbacks are passed through unchanged. Regression tests cover both suite-level and per-test Effect hooks, including the repository's concurrent test configuration.
I think effect/vitest should just wrap all the hooks. Including
{before,after,around}{Each,All}
What is the feature you are proposing to solve the problem?
A solution, similar to #6450, but the effect should also have access to the outer layer injected by it.layer.
What alternatives have you considered?
Wrap the effect in Effect.runPromise myself in vanilla vitest beforeEach. However, they don't have access to the layer.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 11 h 33 min
- PR fusionados (30 d)
- 855
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
-
`fromJsonSchemaDocument`: import open `patternProperties`Posiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10048 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`fromJsonSchemaDocument`: intersect an object with `anyOf` branches that re-declare an enum propertyAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
`fromJsonSchemaDocument`: import `dependentRequired` (draft-07 `dependencies`)Posiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10046 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`fromJsonSchemaDocument`: import `if` / `then` / `else`Posiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10045 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`fromJsonSchemaDocument`: import the `not` keywordPosiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10044 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
gnosis/gnosis_vpn#661 ·
Los mantenedores suelen responder en 1 día
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Abiertotriage:bug-verified
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Eyevinn/open-videocore#1300 ·
Los mantenedores suelen responder en 1 día
-
nextjs-tracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
cloudflare/vinext#4390 ·
Los mantenedores suelen responder en 1 día
-
kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
kubernetes-sigs/headlamp#8175 ·
Los mantenedores suelen responder en 2 días