Add Vitest, CI test gates, and add unit tests #4

Merged
araemer merged 21 commits from add-vitest into meal-plan 2026-06-14 06:40:19 +00:00
Owner

Summary

  • Installs Vitest and @vitest/coverage-v8; adds test, test:watch, and test:coverage scripts
  • Adds a pr_check.yaml workflow that runs tests on every PR targeting stage or main; adds a test step to both deploy workflows so a failing suite blocks deployments
  • Adds reflect-metadata setup file required for TypeORM decorators in tests
  • Adds 13 unit tests for CommentHandler covering createComment, updateComment, and deleteComment — validation, ownership, admin bypass, not-found, and forbidden paths

Test plan

  • npm test passes locally
  • Review test structure and coverage of CommentHandler
  • Confirm branch protection rule is set up in Forgejo for stage and main requiring the test status check
## Summary - Installs Vitest and `@vitest/coverage-v8`; adds `test`, `test:watch`, and `test:coverage` scripts - Adds a `pr_check.yaml` workflow that runs tests on every PR targeting `stage` or `main`; adds a test step to both deploy workflows so a failing suite blocks deployments - Adds `reflect-metadata` setup file required for TypeORM decorators in tests - Adds 13 unit tests for `CommentHandler` covering `createComment`, `updateComment`, and `deleteComment` — validation, ownership, admin bypass, not-found, and forbidden paths ## Test plan - [x] `npm test` passes locally - [x] Review test structure and coverage of `CommentHandler` - [ ] Confirm branch protection rule is set up in Forgejo for `stage` and `main` requiring the `test` status check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
araemer changed title from Add Vitest, CI test gates, and CommentHandler unit tests to Add Vitest, CI test gates, and add unit tests 2026-06-14 05:54:35 +00:00
araemer merged commit d046d9c01c into meal-plan 2026-06-14 06:40:19 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
araemer/recipe-backend!4
No description provided.