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

Make the port optional in `Wait.forHttp`

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
82/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, node.js, typescript
領域
devtools, testing

調査の方向性

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.

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

説明

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.
主要言語
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 を短くまとめたダイジェスト。