@@ -10,7 +10,6 @@ describe('CountItems::CountWorker', () => {
10
10
mongoMock . close . mockReset ( ) ;
11
11
mongoMock . setup . mockReset ( ) ;
12
12
mongoMock . client . isConnected . mockReset ( ) ;
13
- mongoMock . _getIsTransient . mockReset ( ) ;
14
13
mongoMock . getObjectMDStats . mockReset ( ) ;
15
14
} ) ;
16
15
@@ -22,7 +21,6 @@ describe('CountItems::CountWorker', () => {
22
21
setup : [ null ] ,
23
22
close : [ ] ,
24
23
isConnected : false ,
25
- getIsTransient : [ ] ,
26
24
getObjectMDStats : [ ] ,
27
25
} ,
28
26
incomingMessage : {
@@ -47,7 +45,6 @@ describe('CountItems::CountWorker', () => {
47
45
setup : [ new Error ( 'failed setup' ) ] ,
48
46
close : [ ] ,
49
47
isConnected : false ,
50
- getIsTransient : [ ] ,
51
48
getObjectMDStats : [ ] ,
52
49
} ,
53
50
incomingMessage : {
@@ -98,7 +95,6 @@ describe('CountItems::CountWorker', () => {
98
95
setup : [ ] ,
99
96
close : [ new Error ( 'failed teardown' ) ] ,
100
97
isConnected : true ,
101
- getIsTransient : [ ] ,
102
98
getObjectMDStats : [ ] ,
103
99
} ,
104
100
incomingMessage : {
@@ -124,7 +120,6 @@ describe('CountItems::CountWorker', () => {
124
120
setup : [ ] ,
125
121
close : [ ] ,
126
122
isConnected : true ,
127
- getIsTransient : [ null , true ] ,
128
123
getObjectMDStats : [ null , { value : 42 } ] ,
129
124
} ,
130
125
incomingMessage : {
@@ -151,7 +146,6 @@ describe('CountItems::CountWorker', () => {
151
146
setup : [ ] ,
152
147
close : [ ] ,
153
148
isConnected : true ,
154
- getIsTransient : [ null , true ] ,
155
149
getObjectMDStats : [ new Error ( 'count error' ) ] ,
156
150
} ,
157
151
incomingMessage : {
@@ -180,13 +174,11 @@ describe('CountItems::CountWorker', () => {
180
174
sendFn : testSendFn ,
181
175
client : mongoMock ,
182
176
} ) ;
177
+ w . getIsTransient = jest . fn ( ( bucketInfo , cb ) => cb ( null , true ) ) ;
183
178
mongoMock . setup . mockImplementationOnce ( cb => cb ( ...tc . mock . setup ) ) ;
184
179
mongoMock . close . mockImplementationOnce ( cb => cb ( ...tc . mock . close ) ) ;
185
180
mongoMock . client . isConnected
186
181
. mockImplementationOnce ( ( ) => tc . mock . isConnected ) ;
187
- mongoMock . _getIsTransient . mockImplementationOnce (
188
- ( _a , _b , cb ) => cb ( ...tc . mock . getIsTransient ) ,
189
- ) ;
190
182
mongoMock . getObjectMDStats . mockImplementationOnce (
191
183
( _a , _b , _c , _d , cb ) => cb ( ...tc . mock . getObjectMDStats ) ,
192
184
) ;
@@ -213,10 +205,10 @@ describe('CountItems::CountWorker', () => {
213
205
_creationDate : Date . now ( ) . toString ( ) ,
214
206
website : { indexDocument : 'index.html' } ,
215
207
} ;
208
+ w . getIsTransient = jest . fn ( ( bucketInfo , cb ) => cb ( null , true ) ) ;
216
209
mongoMock . setup . mockImplementationOnce ( cb => cb ( ) ) ;
217
210
mongoMock . close . mockImplementationOnce ( cb => cb ( ) ) ;
218
211
mongoMock . client . isConnected . mockImplementationOnce ( ( ) => false ) ;
219
- mongoMock . _getIsTransient . mockImplementationOnce ( ( _a , _b , cb ) => cb ( null , true ) ) ;
220
212
mongoMock . getObjectMDStats . mockImplementationOnce ( ( _a , _b , _c , _d , cb ) => cb ( null , { value : 42 } ) ) ;
221
213
w . countItems ( bucketInfo , ( err , results ) => {
222
214
expect ( err ) . toBeNull ( ) ;
0 commit comments