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

Make the port optional in `Wait.forHttp`

Abierto
#1,534 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
82/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, node.js, typescript
Área
devtools, testing

Línea de trabajo

Start with packages/testcontainers/src/wait-strategies/wait.ts and packages/testcontainers/src/wait-strategies/http-wait-strategy.ts to trace how Wait.forHttp creates the HTTP wait strategy and how exposed ports are available. Check the existing API and tests for Wait.forHttp, then add coverage for defaulting to the first exposed port, fluent .forPort(8081), and the existing Wait.forHttp(path, port) call. Done means all three forms work.

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

Descripción

enhancement minor

What happens

Wait.forHttp(path, port, options) requires the port, even for the usual case of a container with one exposed port:

new GenericContainer(image)
  .withExposedPorts(8080)
  .withWaitStrategy(Wait.forHttp("/health", 8080));

The port is repeated, and in a module it has to be kept in step with the exposed port by hand. Because options is the third positional parameter, it cannot be passed without the port.

Expected

  • The port is optional and defaults to the first exposed port.
  • The port can be set fluently, for example Wait.forHttp("/health").forPort(8081).
  • Wait.forHttp(path, port) keeps working.

Where

  • packages/testcontainers/src/wait-strategies/wait.ts
  • packages/testcontainers/src/wait-strategies/http-wait-strategy.ts

Notes

  • Java's Wait.forHttp(String path) takes only the path, uses the container's first exposed port by default, and has forPort(int) and Wait.forHttps(path).
  • Related: #1507, which is about the options argument (abortOnContainerExit).

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.