Skip to content

Backend testing guide and mocking patterns #566

Closed

Description

@codebestia

Write apps/backend/docs/testing.md: the backend-specific companion to the cross-app testing guide. The suite has strong, repeated conventions that are currently only learnable by reading dozens of files, and getting them wrong produces confusing failures rather than clear ones.

Acceptance criteria:

  • Documents the standard mock set for a route test (db/index.js, db/schema.js, drizzle-orm, lib/redis.js, middleware/auth.js) with a copyable skeleton
  • Documents the socket-handler pattern: emit through the enveloped dispatch event, and why grabbing a raw listener no longer works
  • Explains the Drizzle chain-mocking traps — .values() needing to be thenable and expose .returning()
  • Documents that service mocks must be added when a route gains a new dependency
  • Documents resetting shared in-process state (rate-limit counters) between tests

Activity

  1. Bezzy2105 commented on Aug 30, 2026

    @Bezzy2105

    @Bezzy2105 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi maintainer, let me work on this issue
    Please assign to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Bezzy2105 to this issue.

  2. AdaBliss commented on Aug 30, 2026

    @AdaBliss

    @AdaBliss has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I’d like to take this issue on. I’ll review the current implementation and relevant project guidelines first, then implement a maintainable solution with tests covering the expected behavior and edge cases

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @AdaBliss to this issue.

  3. drips-wave commented on Aug 30, 2026

    @drips-wave

    Congratulations, @AdaBliss! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @AdaBliss: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  4. github-actions commented on Aug 31, 2026

    @github-actions

    Closed by #600, merged into dev.

  5. drips-wave commented on Aug 31, 2026

    @drips-wave

    This issue has been completed by @AdaBliss as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @AdaBliss: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions