{{ message }}
Repository navigation
feat(administration): fail early when an extension runs the Jest harness with another Jest major - #21846
Closed
Gerrit Weiermann (gweiermann) wants to merge 3 commits into
Conversation
…ess with another jest major The harness's test environment and transformers are built against the Administration's Jest. An extension that runs its specs with its own Jest of another major now gets an error naming both versions, the Jest major to install and admin:test-extensions as the alternative, instead of failing on API mismatches inside the harness. The running Jest is read from the jest-config package in the module cache, which is the package that imports the config file. When no single jest-config is loaded, e.g. when a script calls the factory, the check is skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/admin-extension-test-command #21846 +/- ##
==================================================================
Coverage 71.58% 71.58%
==================================================================
Files 5969 5968 -1
Lines 218989 218984 -5
Branches 12099 12099
==================================================================
- Hits 156768 156766 -2
+ Misses 58379 58374 -5
- Partials 3842 3844 +2 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…nsion-jest-version-check
…nsion-jest-version-check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

1. Why is this change necessary?
Stacked on #21822. Extensions can run their specs on the Administration's Jest harness (#21797) with their own Jest installation, as SwagCommercial does.
That only works while the extension's Jest has the Administration's major version: the harness's test environment and transformers come from the Administration's Jest. Once the Administration moves to the next Jest major, an extension still on the old one fails with errors deep inside Jest that do not point at the cause.
2. What does this change do, exactly?
jest@^Nto install, andadmin:test-extensionsas the alternativejest-configpackage in the module cache, the package that imports config files; the Jest bin path can name another Jest (import-localhand-over, programmaticrunCLI)jest-configversions are loaded, e.g. when a script builds the config3. Describe each step to reproduce the issue or behaviour.
In an extension with its own Jest of another major than the Administration's, composing the factory as described in #21797:
With the same major, nothing changes.
4. Please link to the relevant issues (if any).
5. Checklist
RELEASE_INFO-6.<current major line>.mdin the upcoming version section for informational changes: what changed, who is affected, and how to adapt.UPGRADE-6.<next major>.mdfor breaking changes and deprecations: what changed, who is affected, and how to adapt.