-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(@aws-amplify/auth): correctly throw the error when the refresh token is expired #1507
Conversation
@@ -864,37 +864,37 @@ export default class AuthClass { | |||
rej(err); | |||
return; | |||
} | |||
}); | |||
|
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.
Can we add a unit test that ensures the these functions are not called concurrently
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.
Minor nitpick on the assertion style
expect.assertions(1); | ||
const spyon3 = jest.spyOn(CognitoUser.prototype, 'getUserData'); | ||
|
||
expect.assertions(2); | ||
try { | ||
await auth.currentUserPoolUser(); | ||
} catch (e) { |
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.
This test should be re-written to use expect().toThrow
. The tests are more readable with this change
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 test will fail when using toThrow
to catch a rejection. I followed the suggestion in this thread: jestjs/jest#1377 (comment)
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Issue #, if available:
fixes #1468
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.