Browse Source

Change test app scripts

Ben Hsieh 8 years ago
parent
commit
5a83b89162
2 changed files with 33 additions and 7 deletions
  1. 8
    0
      src/.flowconfig
  2. 25
    7
      test/tests.js

+ 8
- 0
src/.flowconfig View File

1
+[ignore]
2
+
3
+[include]
4
+
5
+
6
+[libs]
7
+
8
+[options]

+ 25
- 7
test/tests.js View File

13
   Image,
13
   Image,
14
 } from 'react-native';
14
 } from 'react-native';
15
 
15
 
16
-const FILENAME = `${Platform.OS}-0.4.2-${Date.now()}.png`
16
+const FILENAME = `${Platform.OS}-0.5.0-${Date.now()}.png`
17
 // paste your test config here
17
 // paste your test config here
18
 const TEST_SERVER_URL = 'http://192.168.17.193:8123'
18
 const TEST_SERVER_URL = 'http://192.168.17.193:8123'
19
 const DROPBOX_TOKEN = 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4'
19
 const DROPBOX_TOKEN = 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4'
99
 
99
 
100
 })
100
 })
101
 
101
 
102
+// added after 0.4.2
103
+
102
 ctx.describe('Progress report test', (report) => new Promise((resolve) => {
104
 ctx.describe('Progress report test', (report) => new Promise((resolve) => {
103
   let received = 0
105
   let received = 0
104
-  let p1 = RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/22mb-dummy`, {
106
+  let p1 = RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/1mb-dummy`, {
105
       Authorization : 'Bearer abde123eqweje'
107
       Authorization : 'Bearer abde123eqweje'
106
     })
108
     })
107
-    // .progress((written, total) => {
108
-    //   // report(<Info key={`progress = ${written} bytes / ${total} bytes`}/>)
109
-    //   if(written === total)
110
-    //     report(<Assert key="progress goes to 100%" expect={written} actual={total}/>)
111
-    // })
109
+    .progress((written, total) => {
110
+      report(<Info key={`progress = ${written} bytes / ${total} bytes`}/>)
111
+      if(written === total)
112
+        report(<Assert key="progress goes to 100%" expect={written} actual={total}/>)
113
+    })
112
     .then((resp) => {
114
     .then((resp) => {
113
       report(<Assert key="response data should be correct event with progress listener"
115
       report(<Assert key="response data should be correct event with progress listener"
114
         expect={resp.text().substr(0,10)} actual={"1234567890"}/>)
116
         expect={resp.text().substr(0,10)} actual={"1234567890"}/>)
117
 
119
 
118
 }))
120
 }))
119
 
121
 
122
+// FIXME : not yet supported
123
+ctx.describe('Large file download test', (report) => new Promise((resolve) => {
124
+  let received = 0
125
+  let p1 = RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/22mb-dummy`, {
126
+      Authorization : 'Bearer abde123eqweje'
127
+    })
128
+    .then((resp) => {
129
+      report(<Assert key="not supported"
130
+        expect={true} actual={false}/>)
131
+      resolve()
132
+    })
133
+
134
+}))
135
+
136
+// added after 0.5.0
137
+
120
 
138
 
121
 export default ctx
139
 export default ctx