Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Support Effects in vitest setup hooks (Reopened from V3)

Cerrado
#8,246 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@ArjunCodess ya está trabajando en esto.

Desde el 19/9/2026.

  • #9675 de @effect-bot — fusionado

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

enhancement
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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Effect-TS/effect

Todos los issues de Effect-TS/effect

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.