Browse Source

Change test case setting.

Ben Hsieh 8 years ago
parent
commit
e2a5bf4b3a
2 changed files with 5 additions and 2 deletions
  1. 4
    1
      test/test-0.5.1.js
  2. 1
    1
      test/test-0.6.3.js

+ 4
- 1
test/test-0.5.1.js View File

@@ -212,13 +212,14 @@ RNTest.config({
212 212
     </Info>)
213 213
   })
214 214
   .then((res) => {
215
+    try {
215 216
     deb = Date.now()
216 217
     let promise =  RNFetchBlob.fetch('POST', 'https://content.dropboxapi.com/2/files/upload', {
217 218
       Authorization : `Bearer ${DROPBOX_TOKEN}`,
218 219
       'Dropbox-API-Arg': '{\"path\": \"/rn-upload/'+filename+'\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}',
219 220
       'Content-Type' : 'application/octet-stream',
220 221
     }, RNFetchBlob.wrap(res.path()))
221
-    if(Platform.OS === 'ios')
222
+    if(Platform.OS === 'ios') {
222 223
       promise.progress((now, total) => {
223 224
         if(Date.now() - deb < 1000)
224 225
           return
@@ -233,7 +234,9 @@ RNTest.config({
233 234
           </Text>
234 235
         </Info>)
235 236
       })
237
+    }
236 238
     return promise
239
+  } catch(err) { console.log(err) }
237 240
   })
238 241
   .then((res) => {
239 242
     report(<Assert

+ 1
- 1
test/test-0.6.3.js View File

@@ -35,7 +35,7 @@ describe('massive HTTP request', (report, done) => {
35 35
   for(let i=0; i<1500;i++) {
36 36
     let p = RNFetchBlob
37 37
     .config({fileCache : true})
38
-    .fetch('GET', `${TEST_SERVER_URL}/public/github2.png`)
38
+    .fetch('GET', `${TEST_SERVER_URL}/public/github2.jpg`)
39 39
     // .progress(function(current, total){
40 40
     //   progress[this] = current/total
41 41
     // }.bind(i))