@@ -191,6 +191,31 @@ describe('takeSnapshots', () => {
191
191
features : { } ,
192
192
reportToken : 'report-token' ,
193
193
id : 'build-123' ,
194
+ actualTestCount : 0 ,
195
+ } ;
196
+ const ctx = {
197
+ ...createBaseTestContext ( ) ,
198
+ build,
199
+ } as any ;
200
+
201
+ mockWaitForBuildToComplete . mockResolvedValue ( ) ;
202
+ ctx . client . runQuery . mockReturnValueOnce ( {
203
+ app : { build : { changeCount : 0 , status : 'PASSED' , completedAt : 1 } } ,
204
+ } ) ;
205
+
206
+ await takeSnapshots ( ctx , { } as any ) ;
207
+
208
+ expect ( mockWaitForBuildToComplete ) . not . toHaveBeenCalled ( ) ;
209
+ } ) ;
210
+
211
+ it ( 'does not call waitForBuildToComplete if there are no tests' , async ( ) => {
212
+ const build = {
213
+ app : { repository : { provider : 'github' } } ,
214
+ number : 1 ,
215
+ features : { } ,
216
+ reportToken : 'report-token' ,
217
+ id : 'build-123' ,
218
+ actualTestCount : 1 ,
194
219
} ;
195
220
const ctx = {
196
221
...createBaseTestContext ( ) ,
@@ -222,6 +247,7 @@ describe('takeSnapshots', () => {
222
247
features : { } ,
223
248
reportToken : 'report-token' ,
224
249
id : 'build-123' ,
250
+ actualTestCount : 1 ,
225
251
} ;
226
252
const ctx = {
227
253
...createBaseTestContext ( ) ,
@@ -250,6 +276,7 @@ describe('takeSnapshots', () => {
250
276
features : { } ,
251
277
reportToken : 'report-token' ,
252
278
id : 'build-123' ,
279
+ actualTestCount : 1 ,
253
280
} ;
254
281
const ctx = {
255
282
...createBaseTestContext ( ) ,
@@ -283,6 +310,7 @@ describe('takeSnapshots', () => {
283
310
features : { } ,
284
311
reportToken : 'report-token' ,
285
312
id : 'build-123' ,
313
+ actualTestCount : 1 ,
286
314
} ;
287
315
const ctx = {
288
316
...createBaseTestContext ( ) ,
@@ -316,6 +344,7 @@ describe('takeSnapshots', () => {
316
344
features : { } ,
317
345
reportToken : 'report-token' ,
318
346
id : 'build-123' ,
347
+ actualTestCount : 1 ,
319
348
} ;
320
349
const ctx = {
321
350
...createBaseTestContext ( ) ,
@@ -344,6 +373,7 @@ describe('takeSnapshots', () => {
344
373
features : { } ,
345
374
reportToken : 'report-token' ,
346
375
id : 'build-123' ,
376
+ actualTestCount : 1 ,
347
377
} ;
348
378
const ctx = {
349
379
...createBaseTestContext ( ) ,
0 commit comments