23 lines
591 B
TypeScript
23 lines
591 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
|
|
import { authClient } from "#shared/utils/auth-client";
|
|
import { createAuthClient } from "better-auth/vue";
|
|
|
|
const vars = vi.hoisted(() => ({
|
|
mockAuthClient: {
|
|
signIn: vi.fn(),
|
|
signUp: vi.fn(),
|
|
signOut: vi.fn(),
|
|
},
|
|
}));
|
|
|
|
vi.mock("better-auth/vue", () => ({
|
|
createAuthClient: vi.fn(() => vars.mockAuthClient),
|
|
}));
|
|
|
|
describe("auth-client utility", () => {
|
|
it("should create and export the auth client", () => {
|
|
expect(createAuthClient).toHaveBeenCalled();
|
|
expect(authClient).toBe(vars.mockAuthClient);
|
|
});
|
|
});
|