[PR #6683] [MERGED] test(stripe): refactor to use test instance helper #23723

Closed
opened 2026-04-15 21:56:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6683
Author: @bytaesu
Created: 12/11/2025
Status: Merged
Merged: 12/23/2025
Merged by: @himself65

Base: canaryHead: 2025-12-11/test/refactor-stripe-test


📝 Commits (4)

  • a2cb063 test(stripe): refactor stripe test
  • 1112c0c Update packages/stripe/src/stripe.test.ts
  • 4619917 Merge branch 'canary' into 2025-12-11/test/refactor-stripe-test
  • aad94ba test: migrate to getTestInstance

📊 Changes

1 file changed (+606 additions, -382 deletions)

View changed files

📝 packages/stripe/src/stripe.test.ts (+606 -382)

📄 Description

  • Refactor tests to use the getTestInstance helper
  • Add missing endpoints in the "should have subscription endpoints" test case

Summary by cubic

Refactored Stripe tests to use the getTestInstance helper for cleaner setup and consistent session handling. Added missing subscription endpoint assertions for upgradeSubscription and createBillingPortal.

  • Refactors

    • Replaced manual betterAuth/createAuthClient setup, bearer plugin, and setCookieToHeader with getTestInstance and sessionSetter.
    • Created per-test auth/context instances for webhook, event, and subscription flows to reduce duplication and improve reliability.
    • Standardized memoryAdapter usage and updated tests to call client.subscription.* APIs directly.
  • Bug Fixes

    • Completed the "should have subscription endpoints" test with upgradeSubscription and createBillingPortal checks.

Written for commit aad94ba94c. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6683 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 12/11/2025 **Status:** ✅ Merged **Merged:** 12/23/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2025-12-11/test/refactor-stripe-test` --- ### 📝 Commits (4) - [`a2cb063`](https://github.com/better-auth/better-auth/commit/a2cb063456582dc69cf0849732b3069269ac67bb) test(stripe): refactor stripe test - [`1112c0c`](https://github.com/better-auth/better-auth/commit/1112c0ced3257909a0d3594df747e671f1f89f14) Update packages/stripe/src/stripe.test.ts - [`4619917`](https://github.com/better-auth/better-auth/commit/46199176fc37346e1b6690c3b0f568880c75df68) Merge branch 'canary' into 2025-12-11/test/refactor-stripe-test - [`aad94ba`](https://github.com/better-auth/better-auth/commit/aad94ba94c2bba754be81a173d1f60b40fe39484) test: migrate to getTestInstance ### 📊 Changes **1 file changed** (+606 additions, -382 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/stripe.test.ts` (+606 -382) </details> ### 📄 Description - Refactor tests to use the `getTestInstance` helper - Add missing endpoints in the "should have subscription endpoints" test case <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Refactored Stripe tests to use the getTestInstance helper for cleaner setup and consistent session handling. Added missing subscription endpoint assertions for upgradeSubscription and createBillingPortal. - **Refactors** - Replaced manual betterAuth/createAuthClient setup, bearer plugin, and setCookieToHeader with getTestInstance and sessionSetter. - Created per-test auth/context instances for webhook, event, and subscription flows to reduce duplication and improve reliability. - Standardized memoryAdapter usage and updated tests to call client.subscription.* APIs directly. - **Bug Fixes** - Completed the "should have subscription endpoints" test with upgradeSubscription and createBillingPortal checks. <sup>Written for commit aad94ba94c2bba754be81a173d1f60b40fe39484. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:56:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#23723