Skip to content

Commit

Permalink
running style check
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryamAdnan3 committed Apr 16, 2024
1 parent f1e0ed0 commit 9635c83
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/errors/apiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
*/
export class ApiError<T = {}>
extends Error
implements ApiResponse<T | undefined>
{
implements ApiResponse<T | undefined> {
public request: HttpRequest;
public statusCode: number;
public headers: Record<string, string>;
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/errors/responseValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { SchemaValidationError } from '../schema';
*/
export class ResponseValidationError
extends Error
implements ApiResponse<never>
{
implements ApiResponse<never> {
public request: HttpRequest;
public statusCode: number;
public headers: Record<string, string>;
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/http/requestBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ describe('test default request builder behavior with succesful responses', () =>
it('should test request builder with form-data request body and json response body', async () => {
const expectedRequest: HttpRequest = {
method: 'GET',
url: 'http://apimatic.hopto.org:3000/auth/basic/test/requestBuilder?form-data=true',
url:
'http://apimatic.hopto.org:3000/auth/basic/test/requestBuilder?form-data=true',
headers: {
'test-header': 'test-value',
accept: 'application/json',
Expand Down
121 changes: 110 additions & 11 deletions packages/core/test/http/retryConfiguration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
};
Expand All @@ -38,7 +47,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
};
Expand All @@ -61,7 +79,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -81,7 +108,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 0,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -101,7 +137,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -121,7 +166,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -141,7 +195,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -161,7 +224,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -181,7 +253,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -204,7 +285,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand All @@ -224,7 +314,16 @@ describe('Retry Configuration', () => {
maximumRetryWaitTime: 3,
backoffFactor: 2,
httpStatusCodesToRetry: [
408, 413, 429, 500, 502, 503, 504, 521, 522, 524,
408,
413,
429,
500,
502,
503,
504,
521,
522,
524,
],
httpMethodsToRetry: ['GET', 'PUT'] as HttpMethod[],
},
Expand Down

0 comments on commit 9635c83

Please sign in to comment.