Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit da5673a

Browse files
committed
add test case
1 parent 43f50da commit da5673a

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

test/test-0.9.5.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,33 @@ let prefix = ((Platform.OS === 'android') ? 'file://' : '')
5353
//
5454
// })
5555

56-
// describe('#129 memory leaking when enable uploadProgress', (report, done) => {
57-
//
58-
// let file = null
59-
// let count = 0
60-
//
61-
// RNFetchBlob.config({ fileCache : true })
62-
// .fetch('GET', `${TEST_SERVER_URL}/public/6mb-dummy`)
63-
// .then((res) => {
64-
// file = res.path()
65-
// setTimeout(() => {
66-
// for(let i=0;i<20;i++){
67-
// RNFetchBlob.fetch('POST', `${TEST_SERVER_URL}/upload`, {}, RNFetchBlob.wrap(file))
68-
// .uploadProgress(() => {})
69-
// .then(() => {
70-
// if(count > 20) {
71-
// fs.unlink(file)
72-
// report(<Assert key="finished" expect={true} actual={true}/>)
73-
// done()
74-
// }
75-
// })
76-
// }
77-
// }, 3000)
78-
// })
79-
//
80-
// })
56+
describe('#129 memory leaking when enable uploadProgress', (report, done) => {
57+
58+
let file = null
59+
let count = 0
60+
61+
RNFetchBlob.config({ fileCache : true })
62+
.fetch('GET', `${TEST_SERVER_URL}/public/6mb-dummy`)
63+
.then((res) => {
64+
file = res.path()
65+
for(let i=0;i<10;i++){
66+
RNFetchBlob.fetch('POST', `${TEST_SERVER_URL}/upload`, {
67+
'Transfer-Encoding' : 'Chunked'
68+
}, RNFetchBlob.wrap(file))
69+
.uploadProgress((current, total) => {})
70+
.then(() => {
71+
count ++
72+
if(count >= 10) {
73+
fs.unlink(file)
74+
done()
75+
}
76+
})
77+
}
78+
})
79+
80+
})
8181

82-
describe('#131 status code != 200 should not throw an error', (report, done) => {
82+
false && describe('#131 status code != 200 should not throw an error', (report, done) => {
8383

8484
let count = 0
8585
let codes = [404, 500, 501, 403]

0 commit comments

Comments
 (0)