File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,23 @@ const updateSettingsMock = jest.fn(() => 10)
44const deleteDocuments = jest . fn ( ( ) => {
55 return [ { taskUid : 1 } , { taskUid : 2 } ]
66} )
7- const getIndexUids = jest . fn ( ( ) => {
8- return [ 'my_restaurant' , 'restaurant' ]
7+ const getStats = jest . fn ( ( ) => {
8+ return {
9+ databaseSize : 447819776 ,
10+ lastUpdate : '2019-11-15T11:15:22.092896Z' ,
11+ indexes : {
12+ my_restaurant : {
13+ numberOfDocuments : 1 ,
14+ isIndexing : false ,
15+ fieldDistribution : { } ,
16+ } ,
17+ restaurant : {
18+ numberOfDocuments : 1 ,
19+ isIndexing : false ,
20+ fieldDistribution : { } ,
21+ } ,
22+ } ,
23+ }
924} )
1025
1126const getTasks = jest . fn ( ( ) => {
@@ -18,7 +33,7 @@ const getTasks = jest.fn(() => {
1833 }
1934} )
2035
21- const getStats = jest . fn ( ( ) => {
36+ const getIndexStats = jest . fn ( ( ) => {
2237 return { numberOfDocuments : 1 , isIndexing : false , fieldDistribution : { } }
2338} )
2439
@@ -27,13 +42,13 @@ const mockIndex = jest.fn(() => ({
2742 updateDocuments : updateDocumentsMock ,
2843 updateSettings : updateSettingsMock ,
2944 deleteDocuments,
30- getStats,
45+ getStats : getIndexStats ,
3146} ) )
3247
3348// @ts -ignore
3449const mock = jest . fn ( ) . mockImplementation ( ( ) => {
3550 return {
36- getIndexUids ,
51+ getStats ,
3752 index : mockIndex ,
3853 getTasks,
3954 }
You can’t perform that action at this time.
0 commit comments