@@ -130,6 +130,41 @@ describe('Stack tests', () => {
130
130
done ( ) ;
131
131
} ) ;
132
132
133
+ test ( 'Stack initialization with Contentstack Config with fetchOptions, Azure-NA region test' , done => {
134
+ const config : Contentstack . Config = {
135
+ api_key : 'api_key' ,
136
+ delivery_token : 'delivery_token' ,
137
+ environment : 'environment' ,
138
+ region : Contentstack . Region . AZURE_NA ,
139
+ fetchOptions :{
140
+ timeout : 2000 ,
141
+ retryLimit : 4 ,
142
+ retryDelay : 40
143
+ }
144
+ } ;
145
+ const stack = Contentstack . Stack ( config ) ;
146
+
147
+ expect ( stack . cachePolicy ) . toEqual ( Contentstack . CachePolicy . IGNORE_CACHE ) ;
148
+ expect ( stack . environment ) . toEqual ( 'environment' ) ;
149
+ expect ( stack . config . host ) . toEqual ( 'azure-na-cdn.contentstack.com' ) ;
150
+ expect ( stack . config . port ) . toEqual ( 443 ) ;
151
+ expect ( stack . config . version ) . toEqual ( "v3" ) ;
152
+ expect ( stack . fetchOptions . timeout ) . toEqual ( 2000 ) ;
153
+ expect ( stack . fetchOptions . retryLimit ) . toEqual ( 4 ) ;
154
+ expect ( stack . fetchOptions . retryDelay ) . toEqual ( 40 ) ;
155
+ done ( ) ;
156
+ } ) ;
157
+
158
+ test ( 'Stack initialization with region EU test' , done => {
159
+ const stack = Contentstack . Stack ( 'api_key' , 'delivery_token' , 'environment' , Contentstack . Region . AZURE_NA ) ;
160
+ expect ( stack . cachePolicy ) . toEqual ( Contentstack . CachePolicy . IGNORE_CACHE ) ;
161
+ expect ( stack . environment ) . toEqual ( 'environment' ) ;
162
+ expect ( stack . config . host ) . toEqual ( 'azure-na-cdn.contentstack.com' ) ;
163
+ expect ( stack . config . port ) . toEqual ( 443 ) ;
164
+ expect ( stack . config . version ) . toEqual ( "v3" ) ;
165
+ done ( ) ;
166
+ } ) ;
167
+
133
168
test ( 'Stack initialization with region EU and fetchOptions test' , done => {
134
169
const stack = Contentstack . Stack ( 'api_key' , 'delivery_token' , 'environment' , Contentstack . Region . EU , {
135
170
timeout : 2000
0 commit comments