New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "fileTemplate" to complement "addFileAttribute" #202
Comments
addFileAttribute and anything that uses the filepath template variable is populated by the location of the test file relative to the project root. The way your issue is written I am not seeing an obvious problem that needs solving. Please elaborate and create a github repo that reproduces this issue and clearly articulates what the expected result is. Thank you |
The issue is in a monorepo, project root != repository root. In my case:
So when I have a test file This is to support integration with GitLab Unit test reports in a monorepo. I have to signify monorepo as it works just fine if project root is the same as repository root. |
I see now I understand. Thanks for taking the time to explain! Right now I think I can safely say we don't have anything built in to jest-junit to easily help with this situation. Feel free to submit a PR adding this functionality and I will review it. Or you could also have a posttest npm script that decorates the junit.xml file that jest-junit creates and prepends the rest of the path. |
I have the exact same use case, here's a PR: #209 |
Super thank you @marvinroger 😎 |
Maybe we can expand this with #256, so we have a way to resolve to the package dir. |
In a monorepo, the package is not at the root of git repository.
Meaning,
addFileAttribute
becomes inaccurate.Please add
fileTemplate
so that we can use like:which will be correct path relative to repository root.
The text was updated successfully, but these errors were encountered: