@hyper-fetch/react
Version:
React hooks and utils for the hyper-fetch
13 lines (10 loc) • 454 B
text/typescript
import { waitFor } from "@testing-library/react";
import type { ClientInstance } from "@hyper-fetch/core";
export const testClientIsolation = async (client: ClientInstance) => {
await waitFor(() => {
expect(client.fetchDispatcher.getAllRunningRequests()).toStrictEqual([]);
expect(client.submitDispatcher.getAllRunningRequests()).toStrictEqual([]);
const cacheKeys = client.cache.keys();
expect(cacheKeys).toStrictEqual([]);
});
};