Files
Homarr/tests/setupVitest.ts

9 lines
253 B
TypeScript
Raw Permalink Normal View History

2023-03-20 23:17:17 +01:00
//setupVitest.js or similar file
import { vi } from 'vitest';
2023-07-21 18:08:40 +09:00
import createFetchMock from 'vitest-fetch-mock';
2023-03-20 23:17:17 +01:00
const fetchMocker = createFetchMock(vi);
// sets globalThis.fetch and globalThis.fetchMock to our mocked version
fetchMocker.enableMocks();