瀏覽代碼

Add test cases #108

Ben Hsieh 8 年之前
父節點
當前提交
27c8d8dd12
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7
    4
      test/test-0.10.0.js

+ 7
- 4
test/test-0.10.0.js 查看文件

@@ -73,15 +73,18 @@ describe('json stream via fs', (report, done) => {
73 73
 })
74 74
 
75 75
 describe('issue #102', (report, done) => {
76
-
77
-  RNFetchBlob.config({ fileCache: true })
76
+  let tmp = null
77
+  RNFetchBlob.config({ fileCache: true, appendExt : 'png' })
78 78
     .fetch('GET', `${TEST_SERVER_URL}/public/github.png`)
79 79
     .then((res) => {
80
+      tmp = res
81
+      RNFetchBlob.ios.previewDocument('file://' + res.path(), 'itms-books:')
80 82
       return RNFetchBlob.fetch('POST', `${TEST_SERVER_URL}/upload-form`, {},
81 83
       [{ name : String(1), data : RNFetchBlob.wrap(res.path()), filename: '#102-test-image.png' }])
82 84
     })
83
-    .then((res) => {
84
-      console.log(res.text())
85
+    .then((res) =>  tmp.flush())
86
+    .then(() => {
87
+      done()
85 88
     })
86 89
 
87 90
 })