Skip to content

Added e2e tests for npm@2 and npm@3 #6364

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

Closed
wants to merge 2 commits 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
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ language: objective-c

osx_image: xcode7.2

cache:
directories:
- node_modules
- .nvm

install:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this setting does not do anything, .nvm is empty on every build and npm install is done fresh.
Not too bad, npm is stable recentlly and takes just 3 minutes

- brew reinstall nvm
- mkdir -p .nvm
Expand All @@ -31,6 +26,16 @@ script:
npm install [email protected]
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" node bots/code-analysis-bot.js
npm run flow && npm test
# testing js e2e with npm3
npm install -g npm@3
npm --version
./scripts/e2e-test.sh --packager
# testing js e2e with npm2
rm -rf node_modules
npm install -g npm@2
npm install
npm --version
./scripts/e2e-test.sh --packager

elif [ "$TEST_TYPE" = e2e-objc ]
then
Expand Down
9 changes: 6 additions & 3 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e
set -x

if [ -z $1 ]; then
echo "Please run the script with --ios, --android or --packager"
echo "Please run the script with --ios, --android or --packager" >&2
exit 1
fi

Expand Down Expand Up @@ -68,6 +68,7 @@ SINOPIA_PID=$!

# Make sure to remove old version of react-native in
# case it was cached
npm cache clear
npm unpublish react-native --force
npm unpublish react-native-cli --force
npm publish $ROOT
Expand Down Expand Up @@ -104,9 +105,11 @@ case $1 in
../node_modules/react-native/packager/packager.sh --nonPersistent &
SERVER_PID=$!
# TODO Start the app and check it renders "Welcome to React Native"
echo "The Android e2e test is not implemented yet"
echo "The Android e2e test is not implemented yet" >&2
exit 1
;;
*)
echo "Please run the script with --ios, --android or --packager"
echo "Please run the script with --ios, --android or --packager" >&2
exit 1
;;
esac