Skip to content

Use latest npm in e2e tests #3735

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

Merged
merged 3 commits into from
Jan 10, 2018
Merged
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
17 changes: 7 additions & 10 deletions tasks/e2e-installs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ fi

if hash npm 2>/dev/null
then
# npm 5 is too buggy right now
if [ $(npm -v | head -c 1) -eq 5 ]; then
npm i -g npm@^4.x
fi;
npm i -g npm@latest
npm cache clean || npm cache verify
fi

Expand Down Expand Up @@ -137,39 +134,39 @@ npm install "$cli_path"
# ******************************************************************************

cd "$temp_app_path"
create_react_app --scripts-version=0.4.0 test-app-version-number
create_react_app --scripts-version=1.0.17 test-app-version-number
cd test-app-version-number

# Check corresponding scripts version is installed.
exists node_modules/react-scripts
grep '"version": "0.4.0"' node_modules/react-scripts/package.json
grep '"version": "1.0.17"' node_modules/react-scripts/package.json
checkDependencies

# ******************************************************************************
# Test --use-npm flag
# ******************************************************************************

cd "$temp_app_path"
create_react_app --use-npm --scripts-version=0.4.0 test-use-npm-flag
create_react_app --use-npm --scripts-version=1.0.17 test-use-npm-flag
cd test-use-npm-flag

# Check corresponding scripts version is installed.
exists node_modules/react-scripts
[ ! -e "yarn.lock" ] && echo "yarn.lock correctly does not exist"
grep '"version": "0.4.0"' node_modules/react-scripts/package.json
grep '"version": "1.0.17"' node_modules/react-scripts/package.json
checkDependencies

# ******************************************************************************
# Test --scripts-version with a tarball url
# ******************************************************************************

cd "$temp_app_path"
create_react_app --scripts-version=https://registry.npmjs.org/react-scripts/-/react-scripts-0.4.0.tgz test-app-tarball-url
create_react_app --scripts-version=https://registry.npmjs.org/react-scripts/-/react-scripts-1.0.17.tgz test-app-tarball-url
cd test-app-tarball-url

# Check corresponding scripts version is installed.
exists node_modules/react-scripts
grep '"version": "0.4.0"' node_modules/react-scripts/package.json
grep '"version": "1.0.17"' node_modules/react-scripts/package.json
checkDependencies

# ******************************************************************************
Expand Down
5 changes: 1 addition & 4 deletions tasks/e2e-kitchensink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ fi

if hash npm 2>/dev/null
then
# npm 5 is too buggy right now
if [ $(npm -v | head -c 1) -eq 5 ]; then
npm i -g npm@^4.x
fi;
npm i -g npm@latest
npm cache clean || npm cache verify
fi

Expand Down
4 changes: 0 additions & 4 deletions tasks/e2e-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ fi

if hash npm 2>/dev/null
then
# npm 5 is too buggy right now
if [ $(npm -v | head -c 1) -eq 5 ]; then
npm i -g npm@^4.x
fi;
npm cache clean || npm cache verify
fi

Expand Down