Closed Tallyb closed 1 year ago
Adding options to the json formatter and to the junit in a single formatOptions: {} entry is cumbersome
I tend to agree, and I like your suggestion, though that would potentially end up being a significant change so let's make another issue for that.
To enable this with the current options structure we'd do something like:
{
"formatOptions": {
"junit": {
"suiteName": "my test suite"
}
}
}
The line in question is here https://github.com/cucumber/cucumber-js/blob/main/src/formatter/junit_formatter.ts#L245. The options
being passed into the constructor has a parsedArgvOptions
prop which should be the format options from the user.
May I work on this? This is my first time contributing so may have a few questions along the way!
Sure @Sam-ScottLogic, go for it! Feel free to ask questions here, or join #committers-js in the Slack https://cucumber.io/docs/community/get-in-touch/
@Sam-ScottLogic Hi am I okay to take a look into this?
@astocker-scottlogic Yes!
🤔 What's the problem you're trying to solve?
currently all reports generated with cucumberjs junit formatter bear the name 'cucumber-js'. It would be great to be able to customize it via format options and cli param
✨ What's your proposed solution?
format option with test suite name.
⛏ Have you considered any alternatives or workarounds?
open for suggestions...
📚 Any additional context?
On a side note, it is not really clear how to configure options in a cucumber.mjs file when there are multiple formtters defined.