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

Document and align the units of sizes and durations

Aperta
#1,542 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
55/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
api, testing

Direzione di ricerca

Start with the listed files: packages/testcontainers/src/types.ts, test-container.ts, generic-container/generic-container.ts, and wait-strategies/composite-wait-strategy.ts. Document each numeric option's unit in JSDoc and add Date support for logs({ since }); the issue leaves the shared size unit decision open, and any unit change needs a major release. Done means the units are documented and Date is accepted, with the size decision resolved.

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

Descrizione

enhancement minor

What happens

Numeric options use different units, and most of them say so only in the docs, or nowhere:

Option Unit Stated in the type or JSDoc
withResourcesQuota({ memory }) gigabytes inline comment
withResourcesQuota({ cpu }) CPUs inline comment
withSharedMemorySize(bytes) bytes parameter name
withStartupTimeout(startupTimeoutMs) milliseconds parameter name
HealthCheck.interval, timeout, startPeriod milliseconds no
stop({ timeout }), restart({ timeout }) milliseconds no
Compose down({ timeout }) milliseconds no
HttpWaitStrategy.withReadTimeout milliseconds parameter name
CompositeWaitStrategy.withDeadline(deadline) milliseconds no
logs({ since }) Unix timestamp in seconds no

Two stand out:

  • Memory is in gigabytes while shared memory is in bytes, so the same container can be configured with withResourcesQuota({ memory: 0.5 }) and withSharedMemorySize(512 * 1024 * 1024).
  • logs({ since }) is the only time value in seconds. It is passed straight to Docker, so a millisecond timestamp such as Date.now() is read as a time far in the future.

Expected

  • Every numeric option documents its unit in JSDoc, so it shows in the editor.
  • logs({ since }) also accepts a Date.
  • Decide whether sizes should share one unit.

Where

  • packages/testcontainers/src/types.ts
  • packages/testcontainers/src/test-container.ts
  • packages/testcontainers/src/generic-container/generic-container.ts
  • packages/testcontainers/src/wait-strategies/composite-wait-strategy.ts

Notes

  • Semver: JSDoc and accepting a Date are additive, hence minor. Changing the unit of an existing option would be major.
  • Related: #734 (memory quota units).

Dependencies

  • Nothing blocks this. It can start now.
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.