Skip to content

chore(site): clean up mocks after each test #12805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 1, 2024
Prev Previous commit
Next Next commit
Mute react-query console.error logs
  • Loading branch information
BrunoQuaresma committed Mar 28, 2024
commit 5f5e453179f4b6f5bb4f89361ef80b0ac00db31f
8 changes: 8 additions & 0 deletions site/src/testHelpers/renderHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ export function createTestQueryClient() {
// Helps create one query client for each test case, to make sure that tests
// are isolated and can't affect each other
return new QueryClient({
logger: {
...console,
// Some tests are designed to throw errors as part of their functionality.
// To avoid unnecessary noise from these expected errors, the code is
// structured to suppress them. If this suppression becomes problematic,
// the code can be refactored to handle query errors on a per-test basis.
error: () => {},
},
defaultOptions: {
queries: {
retry: false,
Expand Down