Skip to content

Instantly share code, notes, and snippets.

@tjunghans
Created January 29, 2024 20:39
Show Gist options
  • Save tjunghans/11b9ed92e5256a88d0cf99b6b583b152 to your computer and use it in GitHub Desktop.
Save tjunghans/11b9ed92e5256a88d0cf99b6b583b152 to your computer and use it in GitHub Desktop.
react-query Jest Mock
// Place this file inside <projectRoot>/__mocks__/react-query.js
export const useQuery = jest
.fn()
.mockReturnValue({ data: {}, isLoading: false, error: {} });
export class QueryClient {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment