Skip to content

Commit 102da6a

Browse files
committed
Add test, fix conflicts
1 parent 705f6c1 commit 102da6a

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/__tests__/httpClient.spec.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import HttpClientException from "../httpClient/httpClientException";
77
import { binlookup } from "../typings";
88
import { ApiConstants } from "../constants/apiConstants";
99
import {paymentMethodsSuccess} from "../__mocks__/checkout/paymentMethodsSuccess";
10-
10+
import Config from "../config";
1111

1212
beforeEach((): void => {
1313
nock.cleanAll();
@@ -177,4 +177,26 @@ describe("HTTP Client", function (): void {
177177
expect(response.paymentMethods).toBeTruthy();
178178
});
179179

180-
});
180+
});
181+
182+
describe('Config class', () => {
183+
const DEFAULT_TIMEOUT = 30000; // Define the default timeout value
184+
185+
test('should set default timeout when no timeout is provided', () => {
186+
// Instantiate the Config class without passing a timeout
187+
const config = new Config();
188+
189+
// Expect that the timeout is set to the default value (30000)
190+
expect(config.connectionTimeoutMillis).toBe(DEFAULT_TIMEOUT);
191+
});
192+
193+
test('should set custom timeout when provided', () => {
194+
// Instantiate the Config class with a custom timeout
195+
const customTimeout = 50000;
196+
const config = new Config({ connectionTimeoutMillis: customTimeout });
197+
198+
// Expect that the timeout is set to the custom value (50000)
199+
expect(config.connectionTimeoutMillis).toBe(customTimeout);
200+
});
201+
});
202+

0 commit comments

Comments
 (0)