[PR #5791] [MERGED] test: export getTestInstance #6225

Closed
opened 2026-03-13 12:51:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5791
Author: @himself65
Created: 11/6/2025
Status: Merged
Merged: 11/6/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/11/05/test-instance


📝 Commits (4)

📊 Changes

6 files changed (+47 additions, -314 deletions)

View changed files

📝 packages/better-auth/src/test-utils/index.ts (+2 -257)
packages/better-auth/src/test-utils/state.ts (+0 -25)
📝 packages/better-auth/src/test-utils/test-instance.ts (+39 -26)
📝 packages/passkey/src/passkey.test.ts (+1 -1)
📝 packages/sso/src/oidc.test.ts (+1 -1)
📝 packages/sso/src/saml.test.ts (+4 -4)

📄 Description

Summary by cubic

Exported getTestInstance from test-utils and simplified the test setup. Default test backend is now sqlite, with dynamic DB support and proper cleanup.

  • New Features

    • Export getTestInstance from test-utils.
    • Export convertSetCookieToCookie from headers.
  • Refactors

    • Unified test instance with dynamic DB imports (sqlite default; postgres, mysql, mongodb supported) and teardown per DB.
    • Switched to createAuthClient and consolidated getAdapter/getMigrations imports.
    • Removed legacy getTestInstanceMemory and state.ts; index.ts now only re-exports the needed helpers.

Written for commit 8797699b4c. 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/5791 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/6/2025 **Status:** ✅ Merged **Merged:** 11/6/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/05/test-instance` --- ### 📝 Commits (4) - [`8f5c273`](https://github.com/better-auth/better-auth/commit/8f5c273eba7a4ff09df59e57d66ed17a9ed54bcf) test: export `getTestInstance` - [`ee98645`](https://github.com/better-auth/better-auth/commit/ee98645c14555550b377d4dfc6135df70af1aa05) fix: import - [`9dd3920`](https://github.com/better-auth/better-auth/commit/9dd392036be2fe609fbdc3392a36842169582d0e) fix: test instance - [`8797699`](https://github.com/better-auth/better-auth/commit/8797699b4ca6dd224867dd88fd6199efd6dc3e06) fix: import ### 📊 Changes **6 files changed** (+47 additions, -314 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/test-utils/index.ts` (+2 -257) ➖ `packages/better-auth/src/test-utils/state.ts` (+0 -25) 📝 `packages/better-auth/src/test-utils/test-instance.ts` (+39 -26) 📝 `packages/passkey/src/passkey.test.ts` (+1 -1) 📝 `packages/sso/src/oidc.test.ts` (+1 -1) 📝 `packages/sso/src/saml.test.ts` (+4 -4) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Exported getTestInstance from test-utils and simplified the test setup. Default test backend is now sqlite, with dynamic DB support and proper cleanup. - **New Features** - Export getTestInstance from test-utils. - Export convertSetCookieToCookie from headers. - **Refactors** - Unified test instance with dynamic DB imports (sqlite default; postgres, mysql, mongodb supported) and teardown per DB. - Switched to createAuthClient and consolidated getAdapter/getMigrations imports. - Removed legacy getTestInstanceMemory and state.ts; index.ts now only re-exports the needed helpers. <sup>Written for commit 8797699b4ca6dd224867dd88fd6199efd6dc3e06. 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-03-13 12:51:38 -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#6225