feat(esm): Test esm template dirs in packages/create-cedar-app#354
Conversation
✅ Deploy Preview for cedarjs canceled.
|
There was a problem hiding this comment.
Greptile Summary
This PR adds snapshot tests for two new ESM (ECMAScript Modules) template directories in the create-cedar-app package. The changes introduce test coverage for esm-ts and esm-js templates, which are modernized versions of the existing TypeScript and JavaScript templates.
The key additions include:
- New path constants for the ESM template directories (
ESM_TS_TEMPLATE_DIRandESM_JS_TEMPLATE_DIR) - Snapshot tests that capture the expected file structure for both ESM templates
- Documentation of the migration from Jest to Vitest in these templates, evidenced by the replacement of
jest.config.jsfiles withvitest.config.ts/jsfiles and the addition ofvitest.setup.ts/jsfiles
These tests follow the established pattern used for existing template tests, using inline snapshots to detect unintentional changes to the template structure. This ensures that when users run create-cedar-app with ESM templates, the scaffolding process maintains consistency and doesn't break due to structural changes. The ESM templates represent a modernization effort, embracing native ES modules and Vitest for testing, which aligns with current JavaScript ecosystem trends.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only adds test coverage without modifying template functionality
- Score reflects straightforward test additions following established patterns, with clear benefits for template integrity
- Pay close attention to the snapshot content to ensure it accurately reflects the intended ESM template structure
1 file reviewed, no comments
Introduce the same kind of tests we already have for the standard template files also for the new esm template files
4/n in a long line of ESM prep PRs that started with #349