nit: This test will pass under certain conditions when it should fail (i.e., false negative).
Specifically, when this.credentials.expiration is undefined, and the expiration property of the value returned by AnonymousStorageCredentialsProvider is a Date object. When this happens, control flow will reach AnonymousCognitoCredentialsProvider, and the test needs a way to distinguish the value returned here from the expected value.
Details
Addresses the concern from https://github.com/aws-observability/aws-rum-web/pull/436.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.