Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add end-to-end test #808

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ script:
node server/generate.js
fi

elif [ "$TEST_TYPE" = e2e ]
then
./scripts/e2e-test.sh

else
echo "Unknown test type: $TEST_TYPE"
exit 1
Expand All @@ -57,6 +61,7 @@ env:
- TEST_TYPE=objc
- TEST_TYPE=js
- TEST_TYPE=build_website
- TEST_TYPE=e2e
global:
- secure: "HlmG8M2DmBUSBh6KH1yVIe/8gR4iibg4WfcHq1x/xYQxGbvleq7NOo04V6eFHnl9cvZCu+PKH0841WLnGR7c4BBf47GVu/o16nXzggPumHKy++lDzxFPlJ1faMDfjg/5vjbAxRUe7D3y98hQSeGHH4tedc8LvTaFLVu7iiGqvjU="

Expand Down
2 changes: 1 addition & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if ARGV.count == 0
else
app_name = ARGV.first
dest = Dir.pwd
puts "Setting up new React Native app in #{dest}"
puts "Setting up moo React Native app in #{dest}"
puts ""

main(dest, app_name)
Expand Down
32 changes: 32 additions & 0 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Abort the mission if any command fails
set -e

SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT=$(dirname $SCRIPTS)
TEMP=$(mktemp -d /tmp/react-native-XXXXXXXX)

# To make sure we actually installed the local version
# of react-native, we will create a temp file inside SampleApp
# and check that it exists after `react-native init`
MARKER=$(mktemp $ROOT/Examples/SampleApp/XXXXXXXX)

function cleanup {
rm $MARKER
}
trap cleanup EXIT

( cd $ROOT && npm link )
( cd $ROOT/react-native-cli && npm link )

npm install -g react-native-cli

cd $TEMP
react-native init EndToEndTest

cd EndToEndTest

# Make sure we installed local version of react-native
ls `basename $MARKER` > /dev/null
xctool -scheme EndToEndTest -sdk iphonesimulator8.1 test