import RNTest from './react-native-testkit/' import React from 'react' import RNFetchBlob from 'react-native-fetch-blob' import { StyleSheet, Text, View, ScrollView, Platform, Dimensions, Image, TouchableOpacity, } from 'react-native'; window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest window.Blob = RNFetchBlob.polyfill.Blob const fs = RNFetchBlob.fs const { Assert, Comparer, Info, prop } = RNTest const describe = RNTest.config({ group : '0.9.5', run : true, expand : false, timeout : 20000, }) const { TEST_SERVER_URL, TEST_SERVER_URL_SSL, FILENAME, DROPBOX_TOKEN, styles } = prop() const dirs = RNFetchBlob.fs.dirs let prefix = ((Platform.OS === 'android') ? 'file://' : '') describe('issue #122 force response data format', (report, done) => { RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/json-dummy.json`, { 'RNFB-Response' : 'base64' }) .then((res) => { let r = RNFetchBlob.base64.decode(res.data) report( , ) return RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/json-dummy.json`) }) .then((res) => { report( ) done() }) .catch(() => { report( ) done() }) })