|
@@ -182,6 +182,33 @@ describe('Upload and download at the same time', (report, done) => {
|
182
|
182
|
|
183
|
183
|
})
|
184
|
184
|
|
|
185
|
+RNTest.config({
|
|
186
|
+ group : '0.5.x',
|
|
187
|
+ run : true,
|
|
188
|
+ expand : false,
|
|
189
|
+ timeout : 30000,
|
|
190
|
+})('Upload and download large file', (report, done) => {
|
|
191
|
+ let filename = '22mb-dummy-' + Date.now()
|
|
192
|
+ RNFetchBlob.config({
|
|
193
|
+ fileCache : true
|
|
194
|
+ })
|
|
195
|
+ .fetch('GET', `${TEST_SERVER_URL}/public/22mb-dummy`)
|
|
196
|
+ .then((res) => {
|
|
197
|
+ return RNFetchBlob.fetch('POST', 'https://content.dropboxapi.com/2/files/upload', {
|
|
198
|
+ Authorization : `Bearer ${DROPBOX_TOKEN}`,
|
|
199
|
+ 'Dropbox-API-Arg': '{\"path\": \"/rn-upload/'+filename+'\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}',
|
|
200
|
+ 'Content-Type' : 'application/octet-stream',
|
|
201
|
+ }, RNFetchBlob.wrap(res.path()))
|
|
202
|
+ })
|
|
203
|
+ .then((res) => {
|
|
204
|
+ report(<Assert
|
|
205
|
+ key="upload should success withou crashing app"
|
|
206
|
+ expect={filename}
|
|
207
|
+ actual={res.json().name}/>)
|
|
208
|
+ done()
|
|
209
|
+ })
|
|
210
|
+})
|
|
211
|
+
|
185
|
212
|
describe('Session create mechanism test', (report, done) => {
|
186
|
213
|
let sessionName = 'foo-' + Date.now()
|
187
|
214
|
testSessionName = sessionName
|