mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-15 13:42:08 +03:00
19 lines
523 B
TypeScript
19 lines
523 B
TypeScript
import nock from "nock";
|
|
import { vi } from "vitest";
|
|
|
|
import { DEFAULT_BACKEND_URL } from "@/lib/config/CONSTANTS";
|
|
|
|
vi.mock("@/lib/context/SupabaseProvider", () => ({
|
|
useSupabase: () => ({}),
|
|
}));
|
|
|
|
export const getNock = (url?: string): nock.Scope => {
|
|
return nock(
|
|
url ?? `${process.env.NEXT_PUBLIC_BACKEND_URL ?? DEFAULT_BACKEND_URL}`
|
|
).defaultReplyHeaders({
|
|
"access-control-allow-origin": "*",
|
|
"access-control-allow-credentials": "true",
|
|
"access-control-allow-headers": "Authorization",
|
|
});
|
|
};
|