2020-08-28 04:54:16 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cp ../../node_modules/mocha/mocha.js libs/mocha.js
|
2020-11-18 02:48:02 +03:00
|
|
|
cp ../../packages/tests/dist/tests.esm.js libs/tests.js
|
|
|
|
|
|
|
|
# Start our fake registry
|
|
|
|
node faux-registry/server.js &
|
|
|
|
REGISTRY=$!
|
2020-08-28 04:54:16 +03:00
|
|
|
|
|
|
|
# Install React (comment this out during debugging)
|
2020-11-18 02:48:02 +03:00
|
|
|
npm install --registry http://localhost:8043
|
|
|
|
|
|
|
|
# Shutdown our fake registry
|
|
|
|
kill $REGISTRY
|
2020-08-28 04:54:16 +03:00
|
|
|
|
|
|
|
# Link any native modules
|
|
|
|
npx react-native link
|
|
|
|
|
|
|
|
pushd ios
|
|
|
|
pod install
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Start the webserver
|
|
|
|
npx react-native start --no-interactive > webserver.log &
|
|
|
|
SERVER=$!
|
|
|
|
|
|
|
|
# Put the watcher in the background so it is ready for the Reporter
|
|
|
|
node watcher.js &
|
|
|
|
WATCHER=$!
|
|
|
|
|
|
|
|
# Run the test application
|
|
|
|
npx react-native run-ios
|
|
|
|
|
|
|
|
# Wait until the Watcher completes (exits with the Reporter status)
|
|
|
|
wait $WATCHER
|
|
|
|
RESULT=$?
|
|
|
|
|
2020-11-18 02:48:02 +03:00
|
|
|
# Shutdown the server
|
2020-08-28 04:54:16 +03:00
|
|
|
kill $SERVER
|
|
|
|
|
|
|
|
# Forward the status
|
|
|
|
exit $RESULT
|