[PR #5787] test: remove runWithUser API #14469

Closed
opened 2026-04-13 09:29:24 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5787

State: closed
Merged: No


Summary by cubic

Refactored test helpers to use runWithUser() instead of signInWithUser() for scoped auth, and updated admin, organization, and email verification tests accordingly. This simplifies header handling and makes permission checks clearer in tests.

  • Refactors
    • Added runWithUser(email, password, fn) in test utils to sign in and pass headers to a callback.
    • Removed signInWithUser from getTestInstance exports.
    • Updated admin and organization tests to wrap calls in runWithUser for non-admin scenarios and invitations.
    • Adjusted email verification test to trigger verification via runWithUser.
    • Minor cleanups around header management and session retrieval.

Written for commit 13a010b79c. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5787 **State:** closed **Merged:** No --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Refactored test helpers to use runWithUser() instead of signInWithUser() for scoped auth, and updated admin, organization, and email verification tests accordingly. This simplifies header handling and makes permission checks clearer in tests. - **Refactors** - Added runWithUser(email, password, fn) in test utils to sign in and pass headers to a callback. - Removed signInWithUser from getTestInstance exports. - Updated admin and organization tests to wrap calls in runWithUser for non-admin scenarios and invitations. - Adjusted email verification test to trigger verification via runWithUser. - Minor cleanups around header management and session retrieval. <sup>Written for commit 13a010b79c4b326de013266de6b80bc9d5075e62. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:29:24 -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#14469