import { TextEncoder, TextDecoder } from "util";
import "@testing-library/jest-dom";
import fetchMock from "jest-fetch-mock";
fetchMock.enableMocks();

global.TextEncoder = TextEncoder;
// @ts-expect-error -- Type mismatch but it works at runtime
global.TextDecoder = TextDecoder;

// Mock crypto.randomUUID
Object.defineProperty(global.crypto, "randomUUID", {
  value: () => "test-uuid",
});
