Skip to content

tests: Pact verification for distributions and payouts - #637

Merged
thlpkee20-wq merged 6 commits into
RevoraOrg:masterfrom
heymide:tests/pact-distributions-payouts
Jul 29, 2026
Merged

tests: Pact verification for distributions and payouts#637
thlpkee20-wq merged 6 commits into
RevoraOrg:masterfrom
heymide:tests/pact-distributions-payouts

Conversation

@heymide

@heymide heymide commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Close: #561

Implementation complete. Here's a summary:
Files created/modified:

  1. src/routes/tests/pact-distributions-payouts.test.ts — Pact provider verification tests (10 tests, all passing). Uses:
  • Verifier from @pact-foundation/pact to validate provider against consumer contracts
  • Stateful mock repositories (StatefulPayoutRepo) that respond based on provider state set via POST /__state
  • Supports both local pact files (PACT_DIR env) and Pact Broker (PACT_BROKER_URL + PACT_BROKER_TOKEN env)
  • 5 verified interactions: successful distribution, successful payouts, empty payouts, unauthorized distribution, unauthorized payouts
  1. pacts/revora-consumer-revora-backend.json — Consumer Pact contract (Pact spec v2) defining 5 expected interactions across both endpoints
  2. package.json — Added @pact-foundation/pact@^17.0.1 dev dependency
    Key design decisions:
  • Routes mounted at root (app.use(createDistributionsRouter(...))) since they already contain full paths
  • Provider state handler returns 200 for unknown/empty state to handle unauthorized interactions (which have no provider state)
  • Sorting order matched to default created_at desc in the contract
  • All existing tests pass (228 tests across distributions/payouts suites)

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@heymide Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@heymide

heymide commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Done, Close: #637

@thlpkee20-wq
thlpkee20-wq merged commit 8a35cb4 into RevoraOrg:master Jul 29, 2026
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.

Pact contract tests: distributions and payouts APIs consumer verification

2 participants