Skip to content

fix: expand <rootDir> in filePathPrefix - #289

Closed
Adichapati wants to merge 1 commit into
jest-community:masterfrom
Adichapati:fix/rootdir-filepath-prefix
Closed

fix: expand <rootDir> in filePathPrefix#289
Adichapati wants to merge 1 commit into
jest-community:masterfrom
Adichapati:fix/rootdir-filepath-prefix

Conversation

@Adichapati

Copy link
Copy Markdown
Contributor

Summary

  • expand in filePathPrefix before joining test paths
  • add coverage for expansion

Test Plan

  • NODE_OPTIONS=--experimental-vm-modules npx jest tests/buildJsonResults.test.js

Closes #256

Copilot AI review requested due to automatic review settings May 10, 2026 03:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the Jest <rootDir> placeholder inside filePathPrefix before it’s joined with each test file’s relative path, enabling absolute/monorepo-friendly file attribute output in generated JUnit JSON/XML.

Changes:

  • Expand <rootDir> in filePathPrefix via the existing replaceRootDirInOutput helper before building per-test filepath.
  • Add a unit test to validate <rootDir> expansion behavior for the generated testcase._attr.file value.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
utils/buildJsonResults.js Expands <rootDir> in filePathPrefix prior to joining it with the test path.
tests/buildJsonResults.test.js Adds coverage asserting <rootDir> expansion in filePathPrefix affects the emitted file attribute.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Adichapati Adichapati closed this by deleting the head repository Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add <rootDir> expansion to filePathPrefix

3 participants