(aws-cdk): use either vitest or Node.js Test Runner for testing instead of jest
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the feature
I followed [Tutorial: Create your first AWS CDK app](https://docs.aws.amazon.com/cdk/v2/guide/hello-world.html) and ran the following command
```console
$ 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`
```console
$ 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](https://vitest.dev/) seems to be becoming popular test framework.
There are [several comparisons](https://www.google.com/search?q=jest+vs+vitest) online, and [npm trends](https://npmtrends.com/jest-vs-vitest) 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](https://nodejs.org/api/test.html) instead. It should have enough features which CDK customers might need for their test setup.
### Proposed Solution
Use [vitest](https://vitest.dev/) or [Node.js Test Runner](https://nodejs.org/api/test.html) instead of jest for unit testing.
### Other Information
npm trends jest vs vitest
### 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
Contributor guide
Assessment
This issue has not been assessed yet.