Skip to content

feat(esm): Test esm template dirs in packages/create-cedar-app#354

Merged
Tobbe merged 1 commit into
mainfrom
tobbe-create-cedar-app-test-esm-templates
Aug 9, 2025
Merged

feat(esm): Test esm template dirs in packages/create-cedar-app#354
Tobbe merged 1 commit into
mainfrom
tobbe-create-cedar-app-test-esm-templates

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented Aug 9, 2025

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

@Tobbe Tobbe added this to the chore milestone Aug 9, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 9, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit b08ee98
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/68976d84dd71040008365b64

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DIR and ESM_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.js files with vitest.config.ts/js files and the addition of vitest.setup.ts/js files

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

Edit Code Review Bot Settings | Greptile

@Tobbe Tobbe changed the title chore(create-cedar-app): Test esm template dirs feat(esm): Test esm template dirs in packages/create-cedar-app Aug 9, 2025
@Tobbe Tobbe merged commit aab845b into main Aug 9, 2025
52 checks passed
@Tobbe Tobbe deleted the tobbe-create-cedar-app-test-esm-templates branch August 9, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant