Browse Source

change test config

Ben Hsieh 8 years ago
parent
commit
25f77e8e20
2 changed files with 28 additions and 27 deletions
  1. 24
    24
      test/test-0.9.5.js
  2. 4
    3
      test/test-init.js

+ 24
- 24
test/test-0.9.5.js View File

28
 
28
 
29
 let prefix = ((Platform.OS === 'android') ? 'file://' : '')
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
 describe('#129 memory leaking when enable uploadProgress', (report, done) => {
56
 describe('#129 memory leaking when enable uploadProgress', (report, done) => {
57
 
57
 

+ 4
- 3
test/test-init.js View File

18
 // test environment variables
18
 // test environment variables
19
 
19
 
20
 prop('FILENAME', `${Platform.OS}-0.8.0-${Date.now()}.png`)
20
 prop('FILENAME', `${Platform.OS}-0.8.0-${Date.now()}.png`)
21
-prop('TEST_SERVER_URL', 'http://192.168.0.14:8123')
22
-prop('TEST_SERVER_URL_SSL', 'https://192.168.0.14:8124')
21
+prop('TEST_SERVER_URL', 'http://192.168.0.11:8123')
22
+prop('TEST_SERVER_URL_SSL', 'https://192.168.0.11:8124')
23
 prop('DROPBOX_TOKEN', 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4')
23
 prop('DROPBOX_TOKEN', 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4')
24
 prop('styles', {
24
 prop('styles', {
25
   image : {
25
   image : {
69
 // require('./test-0.9.0')
69
 // require('./test-0.9.0')
70
 // require('./test-0.9.2')
70
 // require('./test-0.9.2')
71
 // require('./test-0.9.4')
71
 // require('./test-0.9.4')
72
-require('./test-0.9.5')
72
+// require('./test-0.9.5')
73
+require('./test-0.9.6')
73
 // require('./test-fetch')
74
 // require('./test-fetch')
74
 // require('./test-fs')
75
 // require('./test-fs')
75
 // require('./test-xmlhttp')
76
 // require('./test-xmlhttp')