Skip to content

Commit

Permalink
fix bundle size & test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashika112 committed Oct 30, 2024
1 parent fc2b30d commit 0a340cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
"name": "[Analytics] identifyUser (Pinpoint)",
"path": "./dist/esm/analytics/index.mjs",
"import": "{ identifyUser }",
"limit": "15.99 kB"
"limit": "16.00 kB"
},
{
"name": "[Analytics] enable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('getRetryDecider', () => {
jest.resetAllMocks();
});

it('should handle network errors', async () => {
describe('created retryDecider', () => {
const mockNetworkErrorThrownFromFetch = new AmplifyError({
name: AmplifyErrorCode.NetworkError,
message: 'Network Error',
Expand All @@ -35,20 +35,25 @@ describe('getRetryDecider', () => {
test.each([
[
'a network error from the fetch handler',
true,
{
retryable: true,
},
mockNetworkErrorThrownFromFetch,
],
[
'a network error from the XHR handler defined in Storage',
true,
{
retryable: true,
},
mockNetworkErrorThrownFromXHRInStorage,
],
])('when receives %p returns %p', (_, expected, error) => {
])('when receives %p returns %p', async (_, expected, error) => {
const mockResponse = {} as unknown as HttpResponse;
mockErrorParser.mockReturnValueOnce(error);
const retryDecider = getRetryDecider(mockErrorParser);
const result = await retryDecider(mockResponse, error);

expect(retryDecider(mockResponse, error)).resolves.toBe(expected);
expect(result).toEqual(expected);
});
});

Expand Down

0 comments on commit 0a340cf

Please sign in to comment.