queryClient.tsx 652 B

12345678910111213141516171819202122232425
  1. import merge from 'lodash/merge';
  2. import {DEFAULT_QUERY_CLIENT_CONFIG, QueryClient} from 'sentry/utils/queryClient';
  3. export const makeTestQueryClient = () =>
  4. new QueryClient(
  5. merge({}, DEFAULT_QUERY_CLIENT_CONFIG, {
  6. defaultOptions: {
  7. queries: {
  8. // Disable retries for tests to allow them to fail fast
  9. retry: false,
  10. },
  11. mutations: {
  12. // Disable retries for tests to allow them to fail fast
  13. retry: false,
  14. },
  15. },
  16. // Don't want console output in tests
  17. logger: {
  18. log: () => {},
  19. warn: () => {},
  20. error: () => {},
  21. },
  22. })
  23. );