less noisy errors

This commit is contained in:
Paul Carleton 2025-06-03 11:02:34 +01:00
commit 9371006838
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -104,6 +104,9 @@ describe("AuthDebugger", () => {
jest.clearAllMocks();
sessionStorageMock.getItem.mockReturnValue(null);
// Supress
jest.spyOn(console, "error").mockImplementation(() => {});
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
mockRegisterClient.mockResolvedValue(mockOAuthClientInfo);
mockDiscoverOAuthProtectedResourceMetadata.mockRejectedValue(
@ -124,6 +127,10 @@ describe("AuthDebugger", () => {
mockExchangeAuthorization.mockResolvedValue(mockOAuthTokens);
});
afterEach(() => {
jest.restoreAllMocks();
});
const renderAuthDebugger = (props: Partial<AuthDebuggerProps> = {}) => {
const mergedProps = {
...defaultProps,

View file

@ -43,8 +43,6 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
authServerUrl = new URL(resourceMetadata.authorization_servers[0]);
}
} catch (e) {
console.info(`Failed to find protected resource metadata: ${e}`);
console.log(e);
if (e instanceof Error) {
resourceMetadataError = e;
} else {