|
@@ -11,20 +11,20 @@ if [ "$#" -eq 1 ]; then
|
11
|
11
|
TARGET="$1"
|
12
|
12
|
echo 'start ios test'
|
13
|
13
|
else
|
14
|
|
- exit "unreconized target platform $1"
|
|
14
|
+ exit "unrecongized target platform $1, please specify a target platform `ios` or `android`."
|
15
|
15
|
fi
|
16
|
16
|
elif [ "$#" -gt 2 ] && [ "$1" == 'path' ]; then
|
17
|
17
|
TEST_APP_PATH="$2"
|
18
|
18
|
TARGET="$3"
|
19
|
19
|
echo "use exist test app path=$2 target=$3"
|
20
|
20
|
else
|
21
|
|
- exit "unreconized arguments."
|
|
21
|
+ exit "unrecongized arguments."
|
22
|
22
|
fi
|
23
|
23
|
|
24
|
24
|
|
25
|
25
|
# Create new rn project
|
26
|
26
|
if [ "$#" -eq 1 ]; then
|
27
|
|
- echo 'create new app for test ..'
|
|
27
|
+ echo 'creating test app RNFetchBlobTest ..'
|
28
|
28
|
rm -rf "${TEST_APP_NAME}"
|
29
|
29
|
react-native init "${TEST_APP_NAME}"
|
30
|
30
|
fi
|
|
@@ -38,12 +38,12 @@ rnpm link
|
38
|
38
|
# start RN
|
39
|
39
|
cd "${TEST_APP_PATH}"
|
40
|
40
|
if [ "$#" == 4 ]; then
|
41
|
|
- sed -i.bak "s/RNFetchBlobTest/$4/" ./index.test.js
|
|
41
|
+ sed -i.bak "s/${TEST_APP_NAME}/$4/" ./index.test.js
|
42
|
42
|
fi
|
43
|
43
|
react-native "run-${TARGET}"
|
44
|
44
|
|
45
|
45
|
# start test server
|
46
|
|
-cd "${CWD}/test/test-server"
|
|
46
|
+cd "${CWD}/test-server"
|
47
|
47
|
# kill existing server
|
48
|
48
|
kill "$(lsof | grep :8123 | awk '{ printf $2 }')"
|
49
|
49
|
node server
|