Improved code coverage
All checks were successful
Production PR / QA Tests (pull_request) Successful in 42s
All checks were successful
Production PR / QA Tests (pull_request) Successful in 42s
This commit is contained in:
parent
5267657374
commit
ab10b3903a
2 changed files with 59 additions and 0 deletions
23
tests/shared/utils/auth-client.test.ts
Normal file
23
tests/shared/utils/auth-client.test.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue