File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import ApiException from "../services/exception/apiException";
6
6
import HttpClientException from "../httpClient/httpClientException" ;
7
7
import { binlookup } from "../typings" ;
8
8
import { ApiConstants } from "../constants/apiConstants" ;
9
+ import Config from "../config" ;
9
10
10
11
beforeEach ( ( ) : void => {
11
12
nock . cleanAll ( ) ;
@@ -100,4 +101,26 @@ describe("HTTP Client", function (): void {
100
101
expect ( response ) . toEqual < binlookup . ThreeDSAvailabilityResponse > ( threeDSAvailabilitySuccessResponse ) ;
101
102
} ) ;
102
103
103
- } ) ;
104
+ } ) ;
105
+
106
+ describe ( 'Config class' , ( ) => {
107
+ const DEFAULT_TIMEOUT = 30000 ; // Define the default timeout value
108
+
109
+ test ( 'should set default timeout when no timeout is provided' , ( ) => {
110
+ // Instantiate the Config class without passing a timeout
111
+ const config = new Config ( ) ;
112
+
113
+ // Expect that the timeout is set to the default value (30000)
114
+ expect ( config . connectionTimeoutMillis ) . toBe ( DEFAULT_TIMEOUT ) ;
115
+ } ) ;
116
+
117
+ test ( 'should set custom timeout when provided' , ( ) => {
118
+ // Instantiate the Config class with a custom timeout
119
+ const customTimeout = 50000 ;
120
+ const config = new Config ( { connectionTimeoutMillis : customTimeout } ) ;
121
+
122
+ // Expect that the timeout is set to the custom value (50000)
123
+ expect ( config . connectionTimeoutMillis ) . toBe ( customTimeout ) ;
124
+ } ) ;
125
+ } ) ;
126
+
You can’t perform that action at this time.
0 commit comments