[PR #9119] docs(test-utils): clarify production usage #16697

Open
opened 2026-04-13 10:38:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9119
Author: @GautamBytes
Created: 4/11/2026
Status: 🔄 Open

Base: mainHead: docs/testutils-prod-usage


📝 Commits (2)

  • 4aca74c docs(test-utils): clarify production usage
  • 2685ebe chore: add changeset

📊 Changes

4 files changed (+53 additions, -8 deletions)

View changed files

.changeset/clarify-test-utils-production-usage.md (+5 -0)
📝 docs/content/blogs/1-5.mdx (+4 -2)
📝 docs/content/docs/plugins/test-utils.mdx (+33 -4)
📝 packages/better-auth/src/plugins/test-utils/index.ts (+11 -2)

📄 Description

Summary

  • clarify that testUtils does not expose public routes, but does add privileged helpers on ctx.test
  • recommend using a separate test-only auth instance such as auth.test.ts instead of a production auth config
  • document the TypeScript inference tradeoff around conditional plugin arrays
  • align the main docs, 1.5 release blog snippet, and plugin JSDoc example

Closes #9101


Summary by cubic

Clarify production guidance for testUtils: no public routes, but it adds privileged ctx.test helpers; use a test-only auth instance (e.g., auth.test.ts) to avoid shipping helpers and keep TS inference stable. Update docs, the 1.5 blog snippet, and plugin JSDoc with testAuth examples and the conditional plugin-array caveat; add a patch changeset for better-auth.

Written for commit 2685ebed73. Summary will update 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/9119 **Author:** [@GautamBytes](https://github.com/GautamBytes) **Created:** 4/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `docs/testutils-prod-usage` --- ### 📝 Commits (2) - [`4aca74c`](https://github.com/better-auth/better-auth/commit/4aca74c4f95aeb6b8ee25e8a8942b3722054a9ec) docs(test-utils): clarify production usage - [`2685ebe`](https://github.com/better-auth/better-auth/commit/2685ebed73e6f8b748d504d6b6d38b33c079a134) chore: add changeset ### 📊 Changes **4 files changed** (+53 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/clarify-test-utils-production-usage.md` (+5 -0) 📝 `docs/content/blogs/1-5.mdx` (+4 -2) 📝 `docs/content/docs/plugins/test-utils.mdx` (+33 -4) 📝 `packages/better-auth/src/plugins/test-utils/index.ts` (+11 -2) </details> ### 📄 Description ## Summary - clarify that `testUtils` does not expose public routes, but does add privileged helpers on `ctx.test` - recommend using a separate test-only auth instance such as `auth.test.ts` instead of a production auth config - document the TypeScript inference tradeoff around conditional plugin arrays - align the main docs, 1.5 release blog snippet, and plugin JSDoc example Closes #9101 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarify production guidance for `testUtils`: no public routes, but it adds privileged `ctx.test` helpers; use a test-only auth instance (e.g., `auth.test.ts`) to avoid shipping helpers and keep TS inference stable. Update docs, the 1.5 blog snippet, and plugin JSDoc with `testAuth` examples and the conditional plugin-array caveat; add a patch changeset for `better-auth`. <sup>Written for commit 2685ebed73e6f8b748d504d6b6d38b33c079a134. Summary will update 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-13 10:38:55 -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#16697