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

Commit 48c786c

Browse files
committed
Add test case for #225
1 parent 1c73284 commit 48c786c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/test-init.js

+20
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ const describe = RNTest.config({
4242

4343
// init
4444

45+
describe('#225 upload progress should fire correctly', (report, done) => {
46+
47+
let data = '';
48+
let fired = false;
49+
for(let i =0; i< 100000; i++) {
50+
data += 'chunkchunk'
51+
}
52+
let upload = RNFetchBlob.fetch('POST', `${TEST_SERVER_URL}/upload`, {
53+
'Content-Type' : 'text/plain;BASE64'
54+
}, data)
55+
upload.uploadProgress((total, now) => {
56+
console.log(total, now)
57+
fired = true;
58+
})
59+
upload.then(() => {
60+
report(<Assert key="progress event fired" expect={true} actual={fired}/>);
61+
done()
62+
})
63+
})
64+
4565
describe('GET image from server', (report, done) => {
4666

4767
RNFetchBlob

0 commit comments

Comments
 (0)