Enable every plugin recommended preset and replace Biome with ESLint formatting. Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
25 lines
622 B
TypeScript
25 lines
622 B
TypeScript
import type { FC, PropsWithChildren } from "react";
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
|
function createQueryWrapper(queryClient = createTestQueryClient()) {
|
|
const QueryWrapper: FC<PropsWithChildren> = props => (
|
|
<QueryClientProvider client={queryClient}>
|
|
{props.children}
|
|
</QueryClientProvider>
|
|
);
|
|
|
|
return { queryClient, wrapper: QueryWrapper };
|
|
}
|
|
|
|
function createTestQueryClient(): QueryClient {
|
|
return new QueryClient({
|
|
defaultOptions: {
|
|
mutations: { retry: false },
|
|
queries: { retry: false },
|
|
},
|
|
});
|
|
}
|
|
|
|
export { createQueryWrapper, createTestQueryClient };
|