[PR #5634] [CLOSED] test: use toMatchObjectType instead of toMatchTypeOf #6129

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5634
Author: @Bekacru
Created: 10/28/2025
Status: Closed

Base: canaryHead: fix/type-tests


📝 Commits (3)

  • 4fc5334 test: use toMatchObjectType instead of toMatchTypeOf
  • 6185a8e chore: lint
  • 2d3b4c7 fix client types

📊 Changes

2 files changed (+106 additions, -34 deletions)

View changed files

📝 packages/better-auth/src/client/client.test.ts (+59 -24)
📝 packages/better-auth/src/plugins/additional-fields/additional-fields.test.ts (+47 -10)

📄 Description

Summary by cubic

Updated type tests to use toMatchObjectType for clearer object-shape assertions and expanded additionalFields coverage, including $Infer.Session and plugin interop. No runtime changes.

  • Refactors
    • Replaced expectTypeOf(...).toMatchTypeOf with .toMatchObjectType in client and additional-fields tests.
    • Switched session type checks to client.$Infer.Session; adjusted expectations for nullable/optional fields (image, nonRequiredFiled).
    • Added tests to verify compatibility with twoFactorClient and jwtClient.

🔄 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/5634 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 10/28/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/type-tests` --- ### 📝 Commits (3) - [`4fc5334`](https://github.com/better-auth/better-auth/commit/4fc533495076d51f5af42d3a6fff3a9b83234c92) test: use toMatchObjectType instead of toMatchTypeOf - [`6185a8e`](https://github.com/better-auth/better-auth/commit/6185a8e5aba111370f0b8f513fb72a53a49d44cb) chore: lint - [`2d3b4c7`](https://github.com/better-auth/better-auth/commit/2d3b4c7b50debab2656345040855c67e673f07c6) fix client types ### 📊 Changes **2 files changed** (+106 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/client.test.ts` (+59 -24) 📝 `packages/better-auth/src/plugins/additional-fields/additional-fields.test.ts` (+47 -10) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Updated type tests to use toMatchObjectType for clearer object-shape assertions and expanded additionalFields coverage, including $Infer.Session and plugin interop. No runtime changes. - **Refactors** - Replaced expectTypeOf(...).toMatchTypeOf with .toMatchObjectType in client and additional-fields tests. - Switched session type checks to client.$Infer.Session; adjusted expectations for nullable/optional fields (image, nonRequiredFiled). - Added tests to verify compatibility with twoFactorClient and jwtClient. <!-- 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:48:46 -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#6129