Skip to content

Commit

Permalink
Merge branch 'main' into GH-9824/pubsub/connection-state-02-realtime-…
Browse files Browse the repository at this point in the history
…implementation
  • Loading branch information
stocaaro authored Jul 29, 2022
2 parents 7233a2a + 2ac9035 commit a3f62fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ In your sample project, you can now link specific packages
yarn link @aws-amplify/auth
```

These tests are only necessary if you’re looking to contribute a Pull Request. If you’re just playing locally you don’t need them. However if you’re contributing a Pull Request for anything other than bug fixes it would be best to validate that first because depending on the scope of the change.
Passing unit tests are only necessary if you’re looking to contribute a pull request. If you’re just playing locally, you don’t need them. However, if you’re contributing a pull request for anything other than making a change to the documentation, fixing a formatting issue in the code (i.e., white space, missing semi-colons) or another task that does not impact the functionality of the code, you will need to validate your proposed changes with passing unit tests.

**Using the setup-dev:react-native script to work with React-Native apps**

Expand Down
9 changes: 4 additions & 5 deletions packages/auth/__tests__/auth-unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1736,13 +1736,12 @@ describe('auth unit test', () => {
identityPoolId: 'awsCognitoIdentityPoolId',
mandatorySignIn: false,
});
const errorMessage = new NoUserPoolError(
AuthErrorTypes.MissingAuthConfig
);

const noUserPoolError = Error('No User Pool in the configuration.');

expect.assertions(2);
expect(auth.currentSession().then()).rejects.toThrow(NoUserPoolError);
expect(auth.currentSession().then()).rejects.toEqual(errorMessage);
expect(auth.currentSession().then()).rejects.toThrow(Error);
expect(auth.currentSession().then()).rejects.toEqual(noUserPoolError);
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ export class AuthClass {
logger.debug('Getting current session');
// Purposely not calling the reject method here because we don't need a console error
if (!this.userPool) {
return this.rejectNoUserPool();
return Promise.reject(new Error('No User Pool in the configuration.'));
}

return new Promise((res, rej) => {
Expand Down

0 comments on commit a3f62fa

Please sign in to comment.