Closed gmiklich closed 1 year ago
Can you please elaborate your question a little bit it's not clear to me what you want to achieve
Sure, I'll try to be more specific. I have an angular monorepo that consists of a few libraries and a few apps. When I configure my jest.preset.js
file, I can use syntax like this:
'jest-junit',
{
outputDirectory: '<rootDir>/unit-test-results',
suiteNameTemplate: '{filepath}/{title}',
classNameTemplate: '{classname}.{title}',
}
That will allow the output to be under each individual app's/library's folder structure. That type of syntax even works for the coverageDirectory
(for example: coverageDirectory: '<rootDir>/sonar-reports'
).
However, if I try that syntax to configure the outputDirectory
for jest-sonar
, it complains about not being able to find a "<rootDir>/whatever
" path. So it does not replace the <rootDir>
, and instead takes it as a literal string/part of the path.
Does that help?
That is clear, will add that as a feature
This would be great. I was wondering where my reports were going, and they were in an actual directory called <rootDir>
.
Any update on this? I just noticed this bug as well. Btw thanks for creating this, very useful! :)
I still need to pick it up, I hope to tackle this next week.
Just ran into the same using 0.2.12, I'm open to providing a PR for this feature if you're willing.
Just ran into the same using 0.2.12, I'm open to providing a PR for this feature if you're willing.
Feel free to open a PR
@sh33dafi Feel free to open a PR
Created #58
Locked due to an inactive of 90 days
Is your feature request related to a problem? Please describe. Other reporters, such as jest-junit allow for adding the key "" to the outputDirectory path. It will then replace it for you depending on the root directory values (which can be overridden in monorepos). Not being able to do so results in having to specify the reporter and the output directory in each sub-project's jest config.
Describe the solution you'd like Add a method to replace the rootDir with the actual path (like in the link to jest-junit that was supplied above). Invoke that method when retrieving a filename around here.
Describe alternatives you've considered I've found a workaround by configuring the coverageDirectory to have the string. If I don't supply an outputDirectory for jest-sonar, it will default to that coverage directory value. Someone may want the result to be in a different directory than the coverage, so it's not 100% ideal, but it works for now.