Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add a shared contract test for modules

Aperta
#1,576 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
backend, testing

Direzione di ricerca

Start with the shared helper in packages/testcontainers/src/utils/test-helper.ts, then inspect existing module tests in packages/modules/*/src/*-container.test.ts to see how they create and connect to their containers. Add the contract invocation for each module using its existing test image and cover the listed shared behaviors. Done means every module runs the shared checks; some are expected to fail until the related fixes land.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

maintenance patch

What happens

Each module tests its own happy path. Behaviour that every module should share is not tested per module, so regressions in it pass every suite:

  • starting the same builder twice
  • connecting after restart(), when the mapped ports have changed
  • withReuse() returning the same container, with the module's setup run once
  • a network alias being usable from another container
  • cleanup through await using
  • non-default credentials actually being applied

Expected

A shared contract test that each module runs against its own container:

describeModuleContract({
  create: () => new RedisContainer(IMAGE),
  connect: async (container) => {
    /* resolves when a client can use the container */
  },
});

Where

  • the shared helper in packages/testcontainers/src/utils/test-helper.ts, which modules may already import
  • one call in each packages/modules/*/src/*-container.test.ts

Notes

  • No new images: each module uses the image it already tests with.
  • Some checks will fail on main until the bugs they cover are fixed. Those are the red tests for the fixes.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1520, #1521: the start-twice and reuse checks are the failing tests for those fixes.
Lingua principale
TypeScript
Stelle
2.6k
Fork
274
Merge medio
1g 14h
PR unite (30g)
44

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testcontainers/testcontainers-node

Tutte le issue di testcontainers/testcontainers-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.