🚀 Feature: allow using test file's relative path in xunit reporter output #5289
Labels
area: reporters
involving a specific reporter
status: accepting prs
Mocha can use your help with this one!
type: feature
enhancement proposal
Feature Request Checklist
faq
label, but none matched my issue.Overview
Today, the
xunit
reporter always fills thefile
attribute with the fully qualified path to the file.In CircleCI, when a test fails, they provide a dedicated UI that reads junit-compatible
xml
files and shows failures in a user-friendly way:However, because the fully qualified path is provided, I have to delete the prefix (
/home/circleci/project
) to paste it into my editor to pull up the file.With my jest test suites and the junit reporter, I can easily just click the "copy" icon because it's the relative path:
Suggested Solution
We should introduce a new
reporterOption
for this feature. Perhaps it's calleduseRelativeFilePath
and defaults tofalse
to retain backward compatibility.We could alternatively use a mode like
filePathMode: 'relative' | 'absolute'
, defaulting toabsolute
.Alternatives
For now, I'm just using
sed
to edit the file after it's produced. But it would be nice to remove this additional step.Additional Info
No response
The text was updated successfully, but these errors were encountered: