Няма описание

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import RNTest from './react-native-testkit/'
  2. import React from 'react'
  3. import RNFetchBlob from 'react-native-fetch-blob'
  4. import {
  5. StyleSheet,
  6. Text,
  7. View,
  8. ScrollView,
  9. Dimensions,
  10. Platform,
  11. Dimension,
  12. Image,
  13. } from 'react-native';
  14. const { Assert, Comparer, Info, prop } = RNTest
  15. // test environment variables
  16. prop('FILENAME', `${Platform.OS}-0.8.0-${Date.now()}.png`)
  17. prop('TEST_SERVER_URL', 'http://192.168.0.11:8123')
  18. prop('TEST_SERVER_URL_SSL', 'https://192.168.0.11:8124')
  19. prop('DROPBOX_TOKEN', 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4')
  20. prop('styles', {
  21. image : {
  22. width: Dimensions.get('window').width*0.9,
  23. height : Dimensions.get('window').width*0.9,
  24. margin : 16,
  25. flex : 1
  26. }
  27. })
  28. const { TEST_SERVER_URL, FILENAME, DROPBOX_TOKEN, styles, image } = prop()
  29. const describe = RNTest.config({
  30. run : true,
  31. expand : true,
  32. timeout : 5000,
  33. })
  34. // init
  35. describe('GET image from server', (report, done) => {
  36. RNFetchBlob
  37. .fetch('GET', `${TEST_SERVER_URL}/public/github.png`, {
  38. Authorization : 'Bearer abde123eqweje'
  39. })
  40. .then((resp) => {
  41. RNTest.prop('image', resp.base64())
  42. report(
  43. <Info key="Response image">
  44. <Image
  45. style={styles.image}
  46. source={{uri : `data:image/png;base64, ${prop('image')}`}}/>
  47. </Info>)
  48. done()
  49. })
  50. })
  51. require('./test-0.1.x-0.4.x')
  52. require('./test-0.5.1')
  53. require('./test-0.5.2')
  54. require('./test-0.6.0')
  55. require('./test-0.6.2')
  56. require('./test-0.7.0')
  57. require('./test-0.8.0')
  58. require('./test-0.9.0')
  59. require('./test-0.9.2')
  60. require('./test-fetch')
  61. require('./test-fs')
  62. require('./test-xmlhttp')
  63. require('./test-blob')
  64. require('./test-firebase')
  65. require('./test-android')
  66. // require('./test-stress')
  67. // require('./benchmark')