import { beforeEach, vi } from "vitest";

const authPath = vi.hoisted(() => new URL("../../auth.ts", import.meta.url).pathname);
vi.mock(authPath, () => ({
  handlers: { GET: vi.fn(), POST: vi.fn() },
}));

describe("Auth route", () => {
  beforeEach(async () => {
    await vi.resetModules();
  });

  it("exports handlers", async () => {
    const authRoute = await import("../../app/api/auth/[...nextauth]/route");

    expect(authRoute.GET).toBeTruthy();
    expect(authRoute.POST).toBeTruthy();
  });
});
