Skip to content

Commit d3ecd6d

Browse files
fsongaearon
authored andcommitted
Fix the e2e test (#699)
* Fix the e2e test In the end-to-end test, we want to test all the latest packages from the monorepo instead of the versions from npm. To do this we will now: * run `lerna bootstrap` in the repo root folder before packaging react-scripts * bundle the deps like we do for releases, so the e2e test uses those packages * Fix copy-pasted comment
1 parent 8b8afd3 commit d3ecd6d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tasks/e2e.sh

+13-4
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,32 @@ clean_path=`mktemp -d 2>/dev/null || mktemp -d -t 'clean_path'`
9696
# Copy some of the react-scripts project files to the temporary folder.
9797
# Exclude folders that definitely won’t be part of the package from processing.
9898
# We will strip the dev-only code there, `npm pack`, and copy the package back.
99-
cd $root_path/packages/react-scripts
99+
cd $root_path
100100
rsync -av --exclude='.git' --exclude=$clean_path\
101101
--exclude='node_modules' --exclude='build'\
102102
'./' $clean_path >/dev/null
103103

104104
# Open the clean folder
105-
cd $clean_path
105+
cd $clean_path/packages/react-scripts
106+
106107
# Now remove all the code relevant to development of Create React App.
107108
files="$(find -L . -name "*.js" -type f)"
108109
for file in $files; do
109110
sed -i.bak '/\/\/ @remove-on-publish-begin/,/\/\/ @remove-on-publish-end/d' $file
110111
rm $file.bak
111112
done
112113

114+
# Install all our packages
115+
cd $clean_path
116+
$root_path/node_modules/.bin/lerna bootstrap
117+
118+
cd $clean_path/packages/react-scripts
119+
120+
# This modifies package.json to copy all dependencies to bundledDependencies
121+
node ./node_modules/.bin/bundle-deps
122+
113123
# Finally, pack react-scripts
114-
npm install
115-
scripts_path=$clean_path/`npm pack`
124+
scripts_path=$clean_path/packages/react-scripts/`npm pack`
116125

117126
# ******************************************************************************
118127
# Now that we have packed them, create a clean app folder and install them.

0 commit comments

Comments
 (0)