Skip to content

test: cover stripe subscription plugin#172

Open
Treasure520520 wants to merge 1 commit into
outerbase:mainfrom
Treasure520520:bounty/71-stripe-plugin-coverage
Open

test: cover stripe subscription plugin#172
Treasure520520 wants to merge 1 commit into
outerbase:mainfrom
Treasure520520:bounty/71-stripe-plugin-coverage

Conversation

@Treasure520520
Copy link
Copy Markdown

/claim #71

Summary

  • Adds focused Vitest coverage for the Stripe subscription plugin without touching production behavior.
  • Covers constructor validation, subscription table initialization, customer lookup/update vs creation, product-to-price subscription creation, missing payment-method rejection, unsubscribe success/not-found behavior, and subscription deletion / checkout completion webhooks.
  • Mocks Stripe API calls with vi.stubGlobal('fetch', ...), so tests do not call the real Stripe API or require Stripe credentials.

Verification

  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec prettier --check plugins/stripe/index.test.ts
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm vitest plugins/stripe/index.test.ts --run -> 11 tests passed
  • git diff --check
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm vitest --run -> new Stripe tests passed; existing unrelated src/rls/index.test.ts baseline still has 4 failures around SELECT/JOIN/subquery policy injection.
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec tsc --noEmit --pretty false -> existing repo type errors remain in CDC/cache/DO/operation files; no errors from plugins/stripe/index.test.ts.

Notes

This is intentionally a non-overlapping plugin coverage slice, separate from the active/rewarded import/export/LiteREST/handler/worker/DO/operation/cache/RLS/allowlist/sql-macros/stats/cron/resend/studio attempts.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant