-
Notifications
You must be signed in to change notification settings - Fork 265
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
Update to [email protected] #319
Conversation
id_token: '456', | ||
expires_in: 2, | ||
}; | ||
(clientMock.getTokenSilently as jest.Mock).mockResolvedValue(tokenResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mocking overloads with jest requires you to cast https://javascript.plainenglish.io/mocking-ts-method-overloads-with-jest-e9c3d3f1ce0c
@@ -2,13 +2,14 @@ const pkg = require('./package.json'); | |||
|
|||
module.exports = { | |||
clearMocks: true, | |||
coveragePathIgnorePatterns: ['/__tests__/'], | |||
coveragePathIgnorePatterns: ['/__tests__/', 'index.tsx'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Istanbul isn't showing coverage for export only files at the moment gotwarlost/istanbul#930
@@ -304,7 +302,8 @@ const Auth0Provider = (opts: Auth0ProviderOptions): JSX.Element => { | |||
); | |||
|
|||
const getAccessTokenSilently = useCallback( | |||
async (opts?: GetTokenSilentlyOptions): Promise<string> => { | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
async (opts?: GetTokenSilentlyOptions): Promise<any> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -28,7 +28,7 @@ const withAuth0 = <P extends WithAuth0Props>( | |||
): ComponentType<Omit<P, keyof WithAuth0Props>> => (props): JSX.Element => ( | |||
<Auth0Context.Consumer> | |||
{(auth: Auth0ContextInterface): JSX.Element => ( | |||
<Component auth0={auth} {...(props as P)} /> | |||
<Component {...(props as P)} auth0={auth} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wrapped component expects auth0: Auth0Client
, so the new version of TS doesn't like that it can be overridden (which would be a bug)
@@ -14,7 +14,8 @@ | |||
"noFallthroughCasesInSwitch": true, | |||
"esModuleInterop": true, | |||
"resolveJsonModule": true, | |||
"forceConsistentCasingInFileNames": true | |||
"forceConsistentCasingInFileNames": true, | |||
"useUnknownInCatchVariables": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make a simpler upgrade path to TS 4.4 https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables
@@ -12,7 +12,6 @@ | |||
"gatsby-plugin-manifest": "^2.4.9", | |||
"gatsby-plugin-offline": "^3.2.7", | |||
"gatsby-plugin-react-helmet": "^3.3.2", | |||
"gatsby-plugin-sharp": "^2.6.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as this was not needed and had a downstream dependency that was failing the build imagemin/imagemin-mozjpeg#70
Description
Upgrade SPA JS to https://github.com/auth0/auth0-spa-js/releases/tag/v1.19.3 and add some overloads for the detailed token response option.
Also upgraded
jest
andtypescript
while I was debugging some jest/ts issuesReferences
auth0-angular equivalent auth0/auth0-angular#231
https://github.com/auth0/auth0-spa-js/releases