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

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

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