(aws-cdk): use either vitest or Node.js Test Runner for testing instead of jest

Đang mở
#936 7 bình luận 10 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ó
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
Ít trao đổi
Công nghệ
node.js, typescript
Lĩnh vực
cli, testing-qa

Hướng nghiên cứu

Xác định template ứng dụng TypeScript được tạo bởi cdk init app và trước tiên kiểm tra package.json được tạo cùng thiết lập kiểm thử của nó. Quyết định giữa Vitest và Node.js Test Runner, sau đó xác minh rằng một project được tạo không còn yêu cầu Jest, ts-jest hoặc @types/jest, đồng thời các unit test của nó chạy thành công.

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

Mô tả

aws-cdk feature-request p2
Describe the feature

I followed Tutorial: Create your first AWS CDK app and ran the following command

$ hello-cdk> cdk --version
2.1031.2 (build 779352d)

$ hello-cdk> cdk init app --language typescript
...

It uses jest by default which requires additional dependency ts-jest for setup, as well as explicit installation of @types/jest

$ grep jest package.json 
    "test": "jest",
    "@types/jest": "^29.5.14",
    "jest": "^29.7.0",
    "ts-jest": "^29.2.5",
Use Case

Over the years, the vitest seems to be becoming popular test framework.

There are several comparisons online, and npm trends shows vitest growing faster than jest.

If cdk init project uses vitest, the CDK customers will benefit from improved performance. Vitest has first-class support for TypeScript, so the types and additional dependencies are not required to be installed.

Even better, the CDK project can just use Node.js test runner instead. It should have enough features which CDK customers might need for their test setup.

Proposed Solution

Use vitest or Node.js Test Runner instead of jest for unit testing.

Other Information
npm trends jest vs vitest Image
Acknowledgements
  • I may be able to implement this feature request
  • This feature might incur a breaking change
CDK version used

2.1031.2

Environment details (OS name and version, etc.)

All

Ngôn ngữ chính
TypeScript
Star
110
Fork
138
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
55

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

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 aws/aws-cdk-cli

Tất cả issue của aws/aws-cdk-cli

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.