Spaces:
Sleeping
Sleeping
Download frontend/src/test/setup.ts from hasimjaneef/omniAI: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/hasimjaneef/omniAI/resolve/main/frontend/src/test/setup.ts
- Command line
-
hf download hf://spaces/hasimjaneef/omniAI/frontend/src/test/setup.ts
-
curl -L -o setup.ts https://huggingface.co/spaces/hasimjaneef/omniAI/resolve/main/frontend/src/test/setup.ts
666 Bytes
| import "@testing-library/jest-dom/vitest"; | |
| import { cleanup } from "@testing-library/react"; | |
| import { afterEach, vi } from "vitest"; | |
| Object.defineProperty(window, "matchMedia", { | |
| writable: true, | |
| value: vi.fn().mockImplementation((query: string) => ({ | |
| matches: false, | |
| media: query, | |
| onchange: null, | |
| addListener: vi.fn(), | |
| removeListener: vi.fn(), | |
| addEventListener: vi.fn(), | |
| removeEventListener: vi.fn(), | |
| dispatchEvent: vi.fn(), | |
| })), | |
| }); | |
| afterEach(() => { | |
| cleanup(); | |
| vi.restoreAllMocks(); | |
| vi.unstubAllGlobals(); | |
| delete (HTMLMediaElement.prototype as HTMLMediaElement & { captureStream?: unknown }) | |
| .captureStream; | |
| }); | |