Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support Effects in vitest setup hooks (Reopened from V3)

クローズ
#8,246 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@ArjunCodess がすでに取り組んでいます。

2026年9月19日 から。

  • #9675 @effect-bot による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
64/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
16.7k
フォーク
808
平均マージ
11時間 11分
マージ済み PR(30日)
840

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Effect-TS/effect のほかの issue

Effect-TS/effect の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。