Browse Source

Change test script and test server

Ben Hsieh 8 years ago
parent
commit
b31cebf238
3 changed files with 16 additions and 3 deletions
  1. 10
    0
      test-server/server.js
  2. 4
    1
      test.sh
  3. 2
    2
      test/test-init.js

+ 10
- 0
test-server/server.js View File

@@ -46,6 +46,16 @@ app.use(function(req,res,next){
46 46
   next()
47 47
 })
48 48
 
49
+app.use('/upload-form', function(req, res, next) {
50
+  console.log(req.headers)
51
+  // req.on('data', (chunk) => {
52
+    // console.log(String(chunk,'utf8'))
53
+  // })
54
+  // req.on('end', () => {
55
+    next()
56
+  // })
57
+})
58
+
49 59
 app.use(upload.any())
50 60
 app.use('/public', express.static('./public'))
51 61
 // for redirect test

+ 4
- 1
test.sh View File

@@ -1,3 +1,7 @@
1
+#!/bin/bash
2
+
3
+set -e
4
+
1 5
 TEST_APP_NAME='RNFetchBlobTest'
2 6
 TEST_APP_PATH="$(pwd)/${TEST_APP_NAME}"
3 7
 TARGET='android'
@@ -25,7 +29,6 @@ fi
25 29
 # Create new rn project
26 30
 if [ "$#" -eq 1 ]; then
27 31
   echo 'creating test app RNFetchBlobTest ..'
28
-  rm -rf "${TEST_APP_NAME}"
29 32
   react-native init "${TEST_APP_NAME}"
30 33
 fi
31 34
 # copy js files to test app folder

+ 2
- 2
test/test-init.js View File

@@ -18,8 +18,8 @@ const { Assert, Comparer, Info, describe, prop } = RNTest
18 18
 // test environment variables
19 19
 
20 20
 prop('FILENAME', `${Platform.OS}-0.6.0-${Date.now()}.png`)
21
-prop('TEST_SERVER_URL', 'http://localhost:8123')
22
-prop('TEST_SERVER_URL_SSL', 'https://localhost:8124')
21
+prop('TEST_SERVER_URL', 'http://192.168.16.70:8123')
22
+prop('TEST_SERVER_URL_SSL', 'https://192.168.16.70:8124')
23 23
 prop('DROPBOX_TOKEN', 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4')
24 24
 prop('styles', {
25 25
   image : {