You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spawned from #3289 / #3313. server/tests/integration/revenue-tracking.test.ts is describe.skip — every test fails with 400 Stripe not configured because the existing mock sets stripe: null while the webhook route requires a non-null Stripe instance to verify signatures.
Fix path
Two reasonable options:
Build a fuller stripe-client mock that exposes:
stripe.webhooks.constructEvent(body, sig, secret) — should pass through a parsed JSON body during tests
stripe.invoices.retrieve(...) and friends as the webhook handlers need
Move revenue-tracking integration tests down to the database layer — drop the HTTP webhook framing and exercise the DB helpers directly with handcrafted invoice payloads. Loses the route-handler signature path but is easier to keep alive across SDK changes.
Acceptance
describe.skip('Revenue Tracking Integration Tests', ...) becomes describe(...) and all 13 tests pass against npm run test:server-integration with a local Postgres.
Context
Spawned from #3289 / #3313.
server/tests/integration/revenue-tracking.test.tsis describe.skip — every test fails with400 Stripe not configuredbecause the existing mock setsstripe: nullwhile the webhook route requires a non-null Stripe instance to verify signatures.Fix path
Two reasonable options:
Build a fuller stripe-client mock that exposes:
stripe.webhooks.constructEvent(body, sig, secret)— should pass through a parsed JSON body during testsstripe.invoices.retrieve(...)and friends as the webhook handlers needSTRIPE_WEBHOOK_SECRETset to a non-null fixturePattern reference:
server/tests/integration/admin-sync-revenue-backfill.test.ts(after test(integration): un-skip 11 of 13 stale integration files (#3289) #3313) shows how to share fixture state acrossvi.mockfactories usingvi.hoisted.Move revenue-tracking integration tests down to the database layer — drop the HTTP webhook framing and exercise the DB helpers directly with handcrafted invoice payloads. Loses the route-handler signature path but is easier to keep alive across SDK changes.
Acceptance
describe.skip('Revenue Tracking Integration Tests', ...)becomesdescribe(...)and all 13 tests pass againstnpm run test:server-integrationwith a local Postgres.Related