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

オープン
#936 コメント 7 件 リアクション 10 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
node.js, typescript
領域
cli, testing-qa

調査の方向性

cdk init app によって生成される TypeScript アプリテンプレートを見つけ、まず生成された package.json とテスト設定を調査します。Vitest と Node.js Test Runner のどちらを採用するか決定し、生成されたプロジェクトで Jest、ts-jest、@types/jest が不要になっていること、およびユニットテストが正常に実行されることを確認します。

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

説明

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

主要言語
TypeScript
スター
110
フォーク
138
平均マージ
1日 9時間
マージ済み PR(30日)
55

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-cdk-cli のほかの issue

aws/aws-cdk-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。