[PR #5394] [MERGED] test: fix issue with msw #5977

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

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/10/17/fix


📝 Commits (1)

📊 Changes

2 files changed (+8 additions, -0 deletions)

View changed files

📝 packages/better-auth/vitest.config.ts (+1 -0)
packages/better-auth/vitest.setup.ts (+7 -0)

📄 Description

Fixes: https://github.com/mswjs/msw/issues/2612

Summary by cubic

Fix MSW tests failing on Node 25 by disabling global localStorage in Vitest setup. Ensures a consistent Node-only environment during tests.

  • Bug Fixes
    • Added vitest.setup.ts to unset globalThis.localStorage when Node >= 25.
    • Registered the setup file in vitest.config.ts via test.setupFiles.

🔄 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/5394 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/17/2025 **Status:** ✅ Merged **Merged:** 10/17/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/17/fix` --- ### 📝 Commits (1) - [`95a3102`](https://github.com/better-auth/better-auth/commit/95a31025d293359d8b3c3d235c22adafdd5d707f) test: fix issue with msw ### 📊 Changes **2 files changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/vitest.config.ts` (+1 -0) ➕ `packages/better-auth/vitest.setup.ts` (+7 -0) </details> ### 📄 Description Fixes: https://github.com/mswjs/msw/issues/2612 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fix MSW tests failing on Node 25 by disabling global localStorage in Vitest setup. Ensures a consistent Node-only environment during tests. - **Bug Fixes** - Added vitest.setup.ts to unset globalThis.localStorage when Node >= 25. - Registered the setup file in vitest.config.ts via test.setupFiles. <!-- 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:43:27 -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#5977