Ignore build files from Jest tests #3155
Merged
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.
What is the context of this PR?
Fixes: #2941
If build files are present in your local repo after running
yarn cdn-bundle
command runningyarn test
will have some failing tests which fail on some JS imports. This is down to the files in the build directory also being run by jest but because these files are copies of the actual ones we want to run. But because these copies are in a different directory and the imports are using relative paths these paths no longer work so the tests fail.This PR changes the Jest config so that those files in the build and templates folders are ignored by Jest, we don't want to run the tests in these folders as we would be running the same tests twice.
How to review this PR
yarn test
on the main branch check that tests passRELEASE_VERSION=70.0.4 yarn cdn-bundle
to create the cdn bundle files in your local repoyarn build
to create the build files in your local repoyarn test
on the main branch and see that the tests now failyarn test
again to see that the files in the build folders are now ignored and the tests passChecklist
This needs to be completed by the person raising the PR.