@@ -28,30 +28,30 @@ const dirs = RNFetchBlob.fs.dirs
28
28
29
29
let prefix = ( ( Platform . OS === 'android' ) ? 'file://' : '' )
30
30
31
- // describe('issue #122 force response data format', (report, done) => {
32
- //
33
- // RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/json-dummy.json`, {
34
- // 'RNFB-Response' : 'base64'
35
- // })
36
- // .then((res) => {
37
- // let r = RNFetchBlob.base64.decode(res.data)
38
- // report(
39
- // <Assert key="test data verify" expect="fetchblob-dev" actual={JSON.parse(r).name}/>,
40
- // <Assert key="should successfully decode the data" expect={true} actual={true}/>)
41
- // return RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/json-dummy.json`)
42
- // })
43
- // .then((res) => {
44
- // report(
45
- // <Assert key="response should in format of plain-text" expect="fetchblob-dev" actual={JSON.parse(res.data).name}/>)
46
- // done()
47
- // })
48
- // .catch(() => {
49
- // report(
50
- // <Assert key="Should successfully decode the data" expect={true} actual={false}/>)
51
- // done()
52
- // })
53
- //
54
- // })
31
+ describe ( 'issue #122 force response data format' , ( report , done ) => {
32
+
33
+ RNFetchBlob . fetch ( 'GET' , `${ TEST_SERVER_URL } /public/json-dummy.json` , {
34
+ 'RNFB-Response' : 'base64'
35
+ } )
36
+ . then ( ( res ) => {
37
+ let r = RNFetchBlob . base64 . decode ( res . data )
38
+ report (
39
+ < Assert key = "test data verify" expect = "fetchblob-dev" actual = { JSON . parse ( r ) . name } /> ,
40
+ < Assert key = "should successfully decode the data" expect = { true } actual = { true } /> )
41
+ return RNFetchBlob . fetch ( 'GET' , `${ TEST_SERVER_URL } /public/json-dummy.json` )
42
+ } )
43
+ . then ( ( res ) => {
44
+ report (
45
+ < Assert key = "response should in format of plain-text" expect = "fetchblob-dev" actual = { JSON . parse ( res . data ) . name } /> )
46
+ done ( )
47
+ } )
48
+ . catch ( ( ) => {
49
+ report (
50
+ < Assert key = "Should successfully decode the data" expect = { true } actual = { false } /> )
51
+ done ( )
52
+ } )
53
+
54
+ } )
55
55
56
56
describe ( '#129 memory leaking when enable uploadProgress' , ( report , done ) => {
57
57
0 commit comments