Demo Site: add unit testing setup with Vitest - #6289
Conversation
Enable writing unit tests in demo/site, matching the existing setup in demo/api and the site packages: jsdom environment, tsconfig path aliases via vite-tsconfig-paths, and a JUnit report for CI test reporting. The root test:unit script picks it up automatically via --if-present. Includes a test for createSitePath as an example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTrAyuuTjXFqBTp9ip9bXp
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe demo site now uses Vitest for unit tests. Its configuration enables jsdom, TypeScript path resolution, and JUnit output. New ChangesVitest unit-test reporting
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR adds a localized Vitest unit-testing setup and CI test command without any supplied evidence of merge-blocking correctness, security, availability, or deployment risk; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Match the file name the test workflow's artifact upload expects. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTrAyuuTjXFqBTp9ip9bXp
Include demo/*/junit-unit.xml in the test-results-unit artifact so demo test reports show up in the test report, alongside the packages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTrAyuuTjXFqBTp9ip9bXp
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR adds isolated Vitest tooling, a focused unit test, lockfile entries, and CI report collection without changing production application code or customer request behavior. Its runtime impact is confined to local and CI test execution. You can add or adjust custom eligibility rules. Learn more. |
Adds a unit testing setup to the site. This was first proposed in vivid-planet/dextinity-starter#395 and rejected due to no real world examples. However, since some of our projects already have a unit testing setup in the site (e.g., an online shop) and writing unit tests becomes effortless with agentic coding, I suggest to revise this decision and add a unit testing setup to the Demo/Starter.
https://claude.ai/code/session_01BTrAyuuTjXFqBTp9ip9bXp