diff --git a/.travis.yml b/.travis.yml index ff8ce54286e713..ebcec89179b55d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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=" diff --git a/init.sh b/init.sh index 3a9216e4a53c44..918c40027269f8 100755 --- a/init.sh +++ b/init.sh @@ -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) diff --git a/scripts/e2e-test.sh b/scripts/e2e-test.sh new file mode 100755 index 00000000000000..1133bcf082df74 --- /dev/null +++ b/scripts/e2e-test.sh @@ -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