1
1
import { paginate , paginateGenerator } from './pagination' ;
2
+ import { AxiosHeaders } from 'axios' ;
2
3
3
4
function * fetchDataGen ( chunkSize : number , items : number ) : any {
4
5
let itemsLeft = items ;
@@ -90,7 +91,9 @@ describe('pagination (accumulating)', () => {
90
91
status : 200 ,
91
92
statusText : 'OK' ,
92
93
headers : { } ,
93
- config : { } ,
94
+ config : {
95
+ headers : { } as AxiosHeaders ,
96
+ } ,
94
97
} ) ;
95
98
96
99
const data = await paginate < Array < any > > (
@@ -129,7 +132,9 @@ describe('pagination (accumulating)', () => {
129
132
status : 200 ,
130
133
statusText : 'OK' ,
131
134
headers : { } ,
132
- config : { } ,
135
+ config : {
136
+ headers : { } as AxiosHeaders ,
137
+ } ,
133
138
} ) ;
134
139
135
140
const data = await paginate < Array < any > > (
@@ -185,7 +190,9 @@ describe('pagination (accumulating)', () => {
185
190
status : 500 ,
186
191
statusText : 'ERROR' ,
187
192
headers : { } ,
188
- config : { } ,
193
+ config : {
194
+ headers : { } ,
195
+ } ,
189
196
} ) ;
190
197
} else {
191
198
return Promise . resolve ( {
@@ -195,7 +202,9 @@ describe('pagination (accumulating)', () => {
195
202
status : 200 ,
196
203
statusText : 'OK' ,
197
204
headers : { } ,
198
- config : { } ,
205
+ config : {
206
+ headers : { } as AxiosHeaders ,
207
+ } ,
199
208
} ) ;
200
209
}
201
210
} ;
@@ -291,7 +300,9 @@ describe('pagination (generator)', () => {
291
300
status : 200 ,
292
301
statusText : 'OK' ,
293
302
headers : { } ,
294
- config : { } ,
303
+ config : {
304
+ headers : { } as AxiosHeaders ,
305
+ } ,
295
306
} ) ;
296
307
297
308
const iterator = paginateGenerator (
@@ -333,7 +344,9 @@ describe('pagination (generator)', () => {
333
344
status : 200 ,
334
345
statusText : 'OK' ,
335
346
headers : { } ,
336
- config : { } ,
347
+ config : {
348
+ headers : { } as AxiosHeaders ,
349
+ } ,
337
350
} ) ;
338
351
339
352
const iterator = paginateGenerator (
@@ -399,7 +412,9 @@ describe('pagination (generator)', () => {
399
412
status : 200 ,
400
413
statusText : 'OK' ,
401
414
headers : { } ,
402
- config : { } ,
415
+ config : {
416
+ headers : { } as AxiosHeaders ,
417
+ } ,
403
418
} ) ;
404
419
}
405
420
} ;
0 commit comments