@@ -71,7 +71,13 @@ describe("zipUpload", () => {
71
71
archivePresent : true ,
72
72
messages : { }
73
73
}
74
- return uploadSuitsrewire ( bsConfig , filePath , opts )
74
+ let obj = {
75
+ bar1 : null ,
76
+ zipInterval : null ,
77
+ size : 0 ,
78
+ startTime : null
79
+ }
80
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
75
81
. then ( ( _data ) => {
76
82
chai . assert . fail ( "Promise error" ) ;
77
83
} )
@@ -87,7 +93,13 @@ describe("zipUpload", () => {
87
93
md5ReturnKey : 'returnKey' ,
88
94
url : 'bs://random_hash'
89
95
}
90
- return uploadSuitsrewire ( bsConfig , filePath , opts )
96
+ let obj = {
97
+ bar1 : null ,
98
+ zipInterval : null ,
99
+ size : 0 ,
100
+ startTime : null
101
+ }
102
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
91
103
. then ( ( data ) => {
92
104
chai . assert . deepEqual ( data , { returnKey : 'bs://random_hash' } ) ;
93
105
} )
@@ -101,7 +113,13 @@ describe("zipUpload", () => {
101
113
let opts = {
102
114
archivePresent : false ,
103
115
}
104
- return uploadSuitsrewire ( bsConfig , filePath , opts )
116
+ let obj = {
117
+ bar1 : null ,
118
+ zipInterval : null ,
119
+ size : 0 ,
120
+ startTime : null
121
+ }
122
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
105
123
. then ( ( data ) => {
106
124
chai . assert . deepEqual ( data , { } ) ;
107
125
} )
@@ -126,7 +144,13 @@ describe("zipUpload", () => {
126
144
archivePresent : true ,
127
145
messages : { }
128
146
}
129
- return uploadSuitsrewire ( bsConfig , filePath , opts )
147
+ let obj = {
148
+ bar1 : null ,
149
+ zipInterval : null ,
150
+ size : 0 ,
151
+ startTime : null
152
+ }
153
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
130
154
. then ( ( data ) => {
131
155
chai . assert . hasAllKeys ( data , [ "time" ] ) ;
132
156
} )
@@ -151,7 +175,13 @@ describe("zipUpload", () => {
151
175
archivePresent : true ,
152
176
messages : { }
153
177
}
154
- return uploadSuitsrewire ( bsConfig , filePath , opts )
178
+ let obj = {
179
+ bar1 : null ,
180
+ zipInterval : null ,
181
+ size : 0 ,
182
+ startTime : null
183
+ }
184
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
155
185
. then ( ( data ) => {
156
186
chai . assert . hasAllKeys ( data , [ "zip_url" , "time" ] ) ;
157
187
} )
@@ -175,7 +205,13 @@ describe("zipUpload", () => {
175
205
archivePresent : true ,
176
206
messages : { }
177
207
}
178
- return uploadSuitsrewire ( bsConfig , filePath , opts )
208
+ let obj = {
209
+ bar1 : null ,
210
+ zipInterval : null ,
211
+ size : 0 ,
212
+ startTime : null
213
+ }
214
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
179
215
. then ( ( _data ) => {
180
216
chai . assert . fail ( "Promise error" ) ;
181
217
} )
@@ -199,7 +235,13 @@ describe("zipUpload", () => {
199
235
archivePresent : true ,
200
236
messages : { }
201
237
}
202
- return uploadSuitsrewire ( bsConfig , filePath , opts )
238
+ let obj = {
239
+ bar1 : null ,
240
+ zipInterval : null ,
241
+ size : 0 ,
242
+ startTime : null
243
+ }
244
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
203
245
. then ( ( _data ) => {
204
246
chai . assert . fail ( "Promise error" ) ;
205
247
} )
@@ -224,7 +266,13 @@ describe("zipUpload", () => {
224
266
messages : { } ,
225
267
propogateError : false
226
268
}
227
- return uploadSuitsrewire ( bsConfig , filePath , opts )
269
+ let obj = {
270
+ bar1 : null ,
271
+ zipInterval : null ,
272
+ size : 0 ,
273
+ startTime : null
274
+ }
275
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
228
276
. then ( ( data ) => {
229
277
chai . assert . deepEqual ( data , { } ) ;
230
278
} )
@@ -249,7 +297,13 @@ describe("zipUpload", () => {
249
297
messages : { } ,
250
298
propogateError : true
251
299
}
252
- return uploadSuitsrewire ( bsConfig , filePath , opts )
300
+ let obj = {
301
+ bar1 : null ,
302
+ zipInterval : null ,
303
+ size : 0 ,
304
+ startTime : null
305
+ }
306
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
253
307
. then ( ( _data ) => {
254
308
chai . assert . fail ( "Promise error" ) ;
255
309
} )
@@ -274,7 +328,13 @@ describe("zipUpload", () => {
274
328
messages : { } ,
275
329
propogateError : true
276
330
}
277
- return uploadSuitsrewire ( bsConfig , filePath , opts )
331
+ let obj = {
332
+ bar1 : null ,
333
+ zipInterval : null ,
334
+ size : 0 ,
335
+ startTime : null
336
+ }
337
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
278
338
. then ( ( _data ) => {
279
339
chai . assert . fail ( "Promise error" ) ;
280
340
} )
@@ -299,7 +359,13 @@ describe("zipUpload", () => {
299
359
messages : { } ,
300
360
propogateError : true
301
361
}
302
- return uploadSuitsrewire ( bsConfig , filePath , opts )
362
+ let obj = {
363
+ bar1 : null ,
364
+ zipInterval : null ,
365
+ size : 0 ,
366
+ startTime : null
367
+ }
368
+ return uploadSuitsrewire ( bsConfig , filePath , opts , obj )
303
369
. then ( ( _data ) => {
304
370
chai . assert . fail ( "Promise error" ) ;
305
371
} )
@@ -320,9 +386,11 @@ describe("zipUpload", () => {
320
386
} ) ;
321
387
322
388
it ( "resolve with test suit" , ( ) => {
389
+ let purgeUploadBarStub = sandbox . stub ( ) . returns ( true ) ;
323
390
zipUploader . __set__ ( {
324
391
utils : utilsStub ,
325
- uploadSuits : uploadSuitsStub
392
+ uploadSuits : uploadSuitsStub ,
393
+ purgeUploadBar : purgeUploadBarStub
326
394
} ) ;
327
395
let uploadCypressZiprewire = zipUploader . __get__ ( 'uploadCypressZip' ) ;
328
396
let bsConfig = { }
@@ -340,9 +408,11 @@ describe("zipUpload", () => {
340
408
341
409
it ( "reject with error while uploading suit" , ( ) => {
342
410
let uploadSuitsErrorStub = sandbox . stub ( ) . returns ( Promise . reject ( "test error" ) ) ;
411
+ let purgeUploadBarStub = sandbox . stub ( ) . returns ( true ) ;
343
412
zipUploader . __set__ ( {
344
413
utils : utilsStub ,
345
- uploadSuits : uploadSuitsErrorStub
414
+ uploadSuits : uploadSuitsErrorStub ,
415
+ purgeUploadBar : purgeUploadBarStub
346
416
} ) ;
347
417
let uploadCypressZiprewire = zipUploader . __get__ ( 'uploadCypressZip' ) ;
348
418
let bsConfig = { }
0 commit comments