Update jest and ts-jest to v29 #363
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.
Resolves
scratch-paintinscratch-guiare currently failing due to a dependency conflict between versions of thetypescriptpackage.Proposed Changes
Update
jestandts-jestto version 29.Supporting change:
scratch-vmnow explicitly exports block types.BREAKING CHANGE:
scratch-vmnow lists default exports under ".", which may be incompatible with some tools.Reason for Changes
The old version of
ts-jestwas only compatible withtypescript@<4. Sincescratch-paintindirectly requirestypescript@^5, that was a problem.Updating to a newer version of
ts-jestrequired updatingjestand (in our case) addingjest-environment-jsdom. Major version mismatches in that group can cause very strange failures, such as jestjs/jest#15674.This caused some minor changes in snapshot behavior and async timing, so I fixed up some unit tests for that.
Updating to a newer
jestalso caused a change in module resolution, breaking the import ofscratch-vm'sBlockTypeenum inscratch-gui/test/unit/util/define-dynamic-block.test.js. To fix that, I added an explicit export forblock-typein theexportssection ofscratch-vm'spackage.jsonfile.Adding a sub-path export to
scratch-vm'sexportsmeant adjusting the top-level exports to all be subpaths, moving the existing conditional exports underneath the"."subpath.I don't know why she swallowed the fly.
Test Coverage
Covered by existing tests.