Ship test-runner helpers for Vitest, Jest and `node:test`
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, typescript
Hướng nghiên cứu
Start by reading the global setup documentation and the existing package layouts under packages/, especially the Java and .NET test runner integrations mentioned in the issue. Then compare how Vitest, Jest, and node:test expose setup, lifecycle, and per-test context APIs. Done means optional packages provide the proposed container declaration and test helpers for all three runners, while respecting that global setup can pass only serialisable connection details.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Using a container from a test runner is wired by hand each time. The global setup page in the docs shows the pattern for one shared container:
- a setup file that starts the container and stores it in a module variable
project.provide("redisUrl", ...)andinject("redisUrl")to pass a serialisable value to the tests- a teardown export that stops it
- a config entry pointing at the setup file
Per-file and per-test containers need their own beforeAll/afterAll pairs or await using.
Expected
Small optional packages that turn this into a declaration, for example for Vitest:
// vitest.setup.ts
export default defineContainers({
redis: () => new RedisContainer("redis:8"),
});
// some.test.ts
const test = withContainers<typeof containers>();
test("stores a value", async ({ redis }) => {
/* redis.connectionUrl */
});
with equivalents for Jest and node:test.
Where
New packages under packages/, outside packages/testcontainers and packages/modules.
Notes
- Java ships
junit-jupiterandspockintegration modules. .NET ships xUnit packages. - A global setup runs in a different process from the tests, so only serialisable connection details can cross. That shapes the API.
- Independent of the core API work.
Dependencies
- Nothing blocks this. It can start now.
- 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
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.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testcontainers/testcontainers-node
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
testcontainers/testcontainers-node#1539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testcontainers/testcontainers-node#1533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
testcontainers/testcontainers-node#1531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
testcontainers/testcontainers-node#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
testcontainers/testcontainers-node#1528 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của testcontainers/testcontainers-node
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
apache/rocketmq-dashboard#6610 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
nextjs-tracking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
cloudflare/vinext#3920 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Team:Dashboards
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
elastic/kibana#297299 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
analytics beginner friendly community contributions-welcome good first issue hacktoberfest help wanted up-for-grabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
affected/v17 affected/v18 area/frontend type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
umbraco/Umbraco-CMS#24186 ·
Maintainer thường phản hồi trong vòng 2 ngày