less noisy errors
This commit is contained in:
parent
0f4a289a4d
commit
9371006838
2 changed files with 7 additions and 2 deletions
|
|
@ -104,6 +104,9 @@ describe("AuthDebugger", () => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
sessionStorageMock.getItem.mockReturnValue(null);
|
sessionStorageMock.getItem.mockReturnValue(null);
|
||||||
|
|
||||||
|
// Supress
|
||||||
|
jest.spyOn(console, "error").mockImplementation(() => {});
|
||||||
|
|
||||||
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
||||||
mockRegisterClient.mockResolvedValue(mockOAuthClientInfo);
|
mockRegisterClient.mockResolvedValue(mockOAuthClientInfo);
|
||||||
mockDiscoverOAuthProtectedResourceMetadata.mockRejectedValue(
|
mockDiscoverOAuthProtectedResourceMetadata.mockRejectedValue(
|
||||||
|
|
@ -124,6 +127,10 @@ describe("AuthDebugger", () => {
|
||||||
mockExchangeAuthorization.mockResolvedValue(mockOAuthTokens);
|
mockExchangeAuthorization.mockResolvedValue(mockOAuthTokens);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.restoreAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
const renderAuthDebugger = (props: Partial<AuthDebuggerProps> = {}) => {
|
const renderAuthDebugger = (props: Partial<AuthDebuggerProps> = {}) => {
|
||||||
const mergedProps = {
|
const mergedProps = {
|
||||||
...defaultProps,
|
...defaultProps,
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,6 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
|
||||||
authServerUrl = new URL(resourceMetadata.authorization_servers[0]);
|
authServerUrl = new URL(resourceMetadata.authorization_servers[0]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.info(`Failed to find protected resource metadata: ${e}`);
|
|
||||||
console.log(e);
|
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
resourceMetadataError = e;
|
resourceMetadataError = e;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue