Skip to content

fix: stop SSHKeysPage from flaking #10553

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 7 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: remove error logging hacks
  • Loading branch information
Parkreiner committed Nov 6, 2023
commit 7dabbe3ca6f961143c7f876ca8ee53e9fe332e41
15 changes: 0 additions & 15 deletions site/src/pages/UserSettingsPage/SSHKeysPage/SSHKeysPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@ import { renderWithAuth } from "testHelpers/renderHelpers";
import { Language as SSHKeysPageLanguage, SSHKeysPage } from "./SSHKeysPage";
import { MockGitSSHKey, mockApiError } from "testHelpers/entities";

/**
* React Query will automatically log all errors outside of production mode,
* even if you're running a test where they're expected
*
* v4 had a way to set custom loggers, but they're removed in v5. Only other
* option is changing the env directly, which feels super dicey
*/
beforeAll(() => {
jest.spyOn(console, "error").mockImplementation(() => {});
});

afterAll(() => {
jest.clearAllMocks();
});

describe("SSH keys Page", () => {
it("shows the SSH key", async () => {
renderWithAuth(<SSHKeysPage />);
Expand Down