Repository navigation
[heft-jest-plugin] Validate managed Jest configuration - #6211
Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Malformed coverageReporters settings can trigger a TypeError instead of an actionable diagnostic because the code calls .some without checking Array.isArray.
1 open issue
What changed in this PR
Adds a configuration-validation foundation for future managed Jest shards in the Heft Jest plugin. Sharded execution remains disabled, and ordinary Jest behavior is unchanged.
Changes:
- Requires V8 for managed coverage and rejects settings incompatible with managed execution.
- Adds tests for accepted and rejected configurations, reporter policies, and non-mutation.
- Documents the preflight utility and adds a minor-release change entry.
| File | Description |
|---|---|
heft-plugins/heft-jest-plugin/src/test/JestManagedConfiguration.test.ts |
Tests validation rules and configuration preservation. |
heft-plugins/heft-jest-plugin/src/JestManagedConfiguration.ts |
Adds managed configuration validation and a shared coverage reporter policy. |
heft-plugins/heft-jest-plugin/README.md |
Documents preflight behavior and the lack of runtime integration. |
common/changes/@rushstack/heft-jest-plugin/jest-managed-config_2026-11-13.json |
Records the feature for a minor release. |
Review effort: Balanced
Comment on lines
+75
to
+77
| jestConfig.coverageReporters?.some( | ||
| (reporter) => typeof reporter !== 'string' || !isSupportedCoverageReporter(reporter) | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
Added an array guard before .some(). Malformed JSON values, including null, now get the managed-coverage diagnostic. Added regression tests for disabled coverage and V8 collection; supported arrays and omitted settings remain accepted.
This branch has not been deployed
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.

Summary
Add configuration validation for future managed Jest shards.
Details
Require V8 when managed coverage is enabled and reject settings incompatible with managed execution. Preserve coverage-disabled runs and ordinary Jest behavior without modifying configuration.
This PR does not enable sharding or add runtime wiring.
How it was tested
node common\scripts\install-run-rush.js test --only @rushstack/heft-jest-plugin— passed build, lint, and 73 tests on Windows with Node 24.22.1.Impacted documentation
Package README only.