Skip to content

[heft-jest-plugin] Add standalone JUnit serialization utility - #6206

Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 1 commit into
microsoft:mainfrom
yashwanth195:user/yverupaka/jest-junit-serializer
Open

Yashwanth Reddy Verupaka (yashwanth195) wants to merge 1 commit into
microsoft:mainfrom
yashwanth195:user/yverupaka/jest-junit-serializer

Conversation

@yashwanth195

Copy link
Copy Markdown
Contributor

Summary

Add a pure Jest-to-JUnit serializer that preserves real assertion identities and outcomes rather than manufacturing passing tests from aggregate counts. This standalone foundation does not enable sharding or JUnit report publication, and has no unmerged PR prerequisites.

Details

  • Keep the minimal input types with the serializer, with no dependency on future collation, payload or coverage modules. Callers validate input and supply canonical ordering.
  • Preserve durations, skipped states, XML 1.0 escaping, supplementary characters and ANSI removal. Represent suite, snapshot, coverage, empty-selection and final-verdict diagnostics explicitly; reject legacy test files without assertion details.
  • Limit the change to the utility, typed-fixture unit tests, a short README note and a changefile. Use existing package exports and dependencies; normal Jest execution is unchanged.

Deferred to integration: payload-v3 capture/validation (including invalid durations), actual manifest collation, ownership/cancellation/atomic XML publication, and end-to-end XML/JSON verdict checks. No junitOutputFile option or filesystem writes are added here.

How it was tested

Windows, Node 24.22.1 and repository Rush 5.182.0. These results validate this standalone port, not the original combined implementation. The committed tree matches the tested tree.

Command (repository root) Result
node common\scripts\install-run-rush.js install --to @rushstack/heft-jest-plugin Passed; locked scoped restore after the initial build found the rig missing. No manifest or lockfile changes.
node common\scripts\install-run-rush.js prettier Passed.
node common\scripts\install-run-rush.js build --to-except @rushstack/heft-jest-plugin --parallelism 4 Passed: 17 prerequisite operations, 2 no-ops.
node common\scripts\install-run-rush.js test --only @rushstack/heft-jest-plugin --parallelism 4 Passed: package build/type-check/ESLint and 20 tests (15 serializer, 5 existing plugin tests).
node common\scripts\install-run-rush.js change --verify --target-branch upstream/main Passed.
git diff --cached --check Passed before commit.

Build and test phases retain the repository's warning-strict settings; no warning overrides were used. Tests use the existing decoupled rig (Jest runner 30.2.0); the package's Jest 30.3.0 dependency declarations are unchanged. No full-monorepo or deferred integration tests were run.

Impacted documentation

Updated the package README with the utility's validated-input boundary. No website or schema changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant