[PR #5527] [MERGED] test: use cookieSetter #14309

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5527
Author: @himself65
Created: 10/23/2025
Status: Merged
Merged: 10/23/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/23/test-simplify


📝 Commits (1)

📊 Changes

1 file changed (+7 additions, -67 deletions)

View changed files

📝 packages/better-auth/src/api/routes/session-api.test.ts (+7 -67)

📄 Description

Summary by cubic

Replaced manual cookie parsing in session API tests with cookieSetter to reduce duplication and ensure consistent cookie setup across session and JWT scenarios. No behavior changes; tests only.

  • Refactors
    • Swapped custom onSuccess handlers for cookieSetter(headers) in session and cookie cache tests.
    • Removed repetitive Set-Cookie parsing and header construction.

🔄 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/5527 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/23/2025 **Status:** ✅ Merged **Merged:** 10/23/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/23/test-simplify` --- ### 📝 Commits (1) - [`89aee41`](https://github.com/better-auth/better-auth/commit/89aee41972972b04948ef74c8f92ac9e02eefb0f) test: use `cookieSetter` ### 📊 Changes **1 file changed** (+7 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/session-api.test.ts` (+7 -67) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Replaced manual cookie parsing in session API tests with cookieSetter to reduce duplication and ensure consistent cookie setup across session and JWT scenarios. No behavior changes; tests only. - **Refactors** - Swapped custom onSuccess handlers for cookieSetter(headers) in session and cookie cache tests. - Removed repetitive Set-Cookie parsing and header construction. <!-- 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 09:24:30 -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#14309