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

Ship test-runner helpers for Vitest, Jest and `node:test`

オープン
#1,578 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, node.js, typescript
領域
testing, tooling

調査の方向性

Start by reading the global setup documentation and the existing package layouts under packages/, especially the Java and .NET test runner integrations mentioned in the issue. Then compare how Vitest, Jest, and node:test expose setup, lifecycle, and per-test context APIs. Done means optional packages provide the proposed container declaration and test helpers for all three runners, while respecting that global setup can pass only serialisable connection details.

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

説明

enhancement minor

What happens

Using a container from a test runner is wired by hand each time. The global setup page in the docs shows the pattern for one shared container:

  • a setup file that starts the container and stores it in a module variable
  • project.provide("redisUrl", ...) and inject("redisUrl") to pass a serialisable value to the tests
  • a teardown export that stops it
  • a config entry pointing at the setup file

Per-file and per-test containers need their own beforeAll/afterAll pairs or await using.

Expected

Small optional packages that turn this into a declaration, for example for Vitest:

// vitest.setup.ts
export default defineContainers({
  redis: () => new RedisContainer("redis:8"),
});

// some.test.ts
const test = withContainers<typeof containers>();
test("stores a value", async ({ redis }) => {
  /* redis.connectionUrl */
});

with equivalents for Jest and node:test.

Where

New packages under packages/, outside packages/testcontainers and packages/modules.

Notes

  • Java ships junit-jupiter and spock integration modules. .NET ships xUnit packages.
  • A global setup runs in a different process from the tests, so only serialisable connection details can cross. That shapes the API.
  • Independent of the core API work.

Dependencies

  • Nothing blocks this. It can start now.
主要言語
TypeScript
スター
2.6k
フォーク
274
平均マージ
1日 14時間
マージ済み PR(30日)
44

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

testcontainers/testcontainers-node のほかの issue

testcontainers/testcontainers-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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