diff --git a/packages/better-auth/src/client/client.test.ts b/packages/better-auth/src/client/client.test.ts index 03d4c136f5..510a7483a0 100644 --- a/packages/better-auth/src/client/client.test.ts +++ b/packages/better-auth/src/client/client.test.ts @@ -493,31 +493,34 @@ describe("type", () => { }, }); - type UseSessionRef = ReturnType; - type UseSessionReturn = UseSessionRef["value"]; - expectTypeOf().toMatchTypeOf<{ - data: { - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - createdAt: Date; - updatedAt: Date; - image?: string | undefined | null; - testField4: string; - testField?: string | undefined | null; - testField2?: number | undefined | null; - }; - session: Session; - } | null; - isPending: boolean; - isRefetching: boolean; - error: BetterFetchError | null; - refetch: ( - queryParams?: { query?: SessionQueryParams } | undefined, - ) => Promise; - }>(); + // Test the function signature directly to avoid overload resolution issues + expectTypeOf(client.useSession).toMatchTypeOf< + () => Readonly< + Ref<{ + data: { + user: { + id: string; + email: string; + emailVerified: boolean; + name: string; + createdAt: Date; + updatedAt: Date; + image?: string | undefined | null; + testField4: string; + testField?: string | undefined | null; + testField2?: number | undefined | null; + }; + session: Session; + } | null; + isPending: boolean; + isRefetching: boolean; + error: BetterFetchError | null; + refetch: ( + queryParams?: { query?: SessionQueryParams } | undefined, + ) => Promise; + }> + > + >(); }); it("should support refetch with query parameters - vanilla", () => {