diff --git a/lib/errors.js b/lib/errors.js index 8027b9b4..82767ca2 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -19,15 +19,11 @@ 'use strict'; function AuthError(problem) { - var err = Error.apply(undefined, [problem.title]); - Object.assign(err, problem); - Object.setPrototypeOf(err, AuthError.prototype); - Object.setPrototypeOf(this, err); - return err; + Error.call(this, problem.title); + Object.assign(this, problem); } -AuthError.prototype = Object.create(Error.prototype, { - constructor: { value: AuthError } -}); +AuthError.__proto__ = Error; +AuthError.prototype.__proto__ = Error.prototype; exports['AuthError'] = AuthError; diff --git a/scripts/test.sh b/scripts/test.sh index 61d9ce33..7183f448 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -282,8 +282,11 @@ case "$TARGET" in xctest ReactExample ;; "react-tests-android") - # download_server - # start_server + if [ "$(uname)" = 'Darwin' ]; then + download_server + start_server + fi + [[ $CONFIGURATION == 'Debug' ]] && exit 0 XCPRETTY='' @@ -317,7 +320,11 @@ case "$TARGET" in echo "********* TESTS COMPLETED *********"; echo "********* File location: $(pwd)/tests.xml *********"; cat tests.xml - # stop_server + + if [ "$(uname)" = 'Darwin' ]; then + stop_server + fi + ;; "node") if [ "$(uname)" = 'Darwin' ]; then diff --git a/tests/react-test-app/run-android.sh b/tests/react-test-app/run-android.sh index a292e9c5..e3265acc 100755 --- a/tests/react-test-app/run-android.sh +++ b/tests/react-test-app/run-android.sh @@ -22,6 +22,9 @@ adb uninstall io.realm.react.testapp || true echo "Reversing port for physical device" adb reverse tcp:8081 tcp:8081 +echo "Reversing port for Realm Object Server" +adb reverse tcp:9080 tcp:9080 + echo "Building Release APK" pushd android && ./gradlew assembleRelease