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

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

Abierto
#1,578 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, node.js, typescript
Área
testing, tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
2.6k
Forks
274
Merge medio
1 d 14 h
PR fusionados (30 d)
44

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 testcontainers/testcontainers-node

Todos los issues de testcontainers/testcontainers-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.