scripts: Don’t remove node_modules from subdirectories of presets in e2e tests #6948
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
After
yarn
andyarn jest
the result ofyarn clean-all
is thatgit status
displays:#6185 added these files and made an exception in
.gitignore
but not inpackage.json
file.Y’all are welcome to improve the
find
command in newclean-e2e
script. I wrote it as clear and cross platform as I know how.Test plan
I used
find . -type d \( -name node_modules -prune \) -print
to explorenode_modules
directories:After
git clone
there are 2 under./e2e
and 4 under./packages
After
yarn
there are more, of course./node_modules
./website/node_modules
12 under
./examples
21 under
.packages
including the following 4 related to the preceding 4After
yarn jest
there are 8 more under./e2e
After original version of
yarn clean-all
removed
./node_modules
removed 17 under
./packages
and kept the 4 fromgit clone
removed 4 under
./e2e
including the 2 fromgit clone
that it should have kept but kept the following 6 the it should have removed (but were not because of./e2e/*/*/node_modules
pattern)Repeat steps 1, 2, 3, and then after improved version of
yarn clean-all
./node_modules
./packages
and kept the 4 fromgit clone
./e2e
and kept the 2 fromgit clone
thereforegit status
displaysnothing to commit, working tree clean