Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add a shared contract test for modules

Đang mở
#1,576 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
65/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, node.js, typescript
Lĩnh vực
backend, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
274
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-node

Tất cả issue của testcontainers/testcontainers-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.