|
@@ -99,5 +99,22 @@ ctx.describe('Compare uploaded multipart image', async function(report) {
|
99
|
99
|
|
100
|
100
|
})
|
101
|
101
|
|
|
102
|
+ctx.describe('Progress report test', (report) => new Promise((resolve) => {
|
|
103
|
+
|
|
104
|
+ let p1 = RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/github.png`, {
|
|
105
|
+ Authorization : 'Bearer abde123eqweje'
|
|
106
|
+ })
|
|
107
|
+ let log = []
|
|
108
|
+
|
|
109
|
+ p1.onProgress = (written, total) => {
|
|
110
|
+ log.push(<Info key={`progress = ${written} bytes / ${total} bytes`}></Info>)
|
|
111
|
+ if(written === total)
|
|
112
|
+ log.push(<Assert key="progress goes to 100%" expect={written} actual={total}/>)
|
|
113
|
+ report(...log)
|
|
114
|
+ resolve()
|
|
115
|
+ }
|
|
116
|
+
|
|
117
|
+}))
|
|
118
|
+
|
102
|
119
|
|
103
|
120
|
export default ctx
|