-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat: support passing reporter options from config #459
Conversation
rebased onto target branch, fixed conflicts, updated snap @bcoe ping |
@@ -25,6 +25,7 @@ exports.outputReport = async function (argv) { | |||
excludeAfterRemap: argv.excludeAfterRemap, | |||
reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter], | |||
reportsDirectory: argv['reports-dir'], | |||
reporterOptions: argv.reporterOptions || {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reporterOptions: argv.reporterOptions || {}, | |
reporterOptions: argv.reporterOptions ?? {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkowalleck apologies for ignoring this for so long, bother you to implement the suggestion. |
My current code reflects existing style. |
@jkowalleck your branch has conflicts, could I bother you to rebase and push. |
will recreate the test snapshots during next week. |
Signed-off-by: Jan Kowalleck <[email protected]>
@bcoe rebased onto main and recreated test snaps |
Signed-off-by: Jan Kowalleck <[email protected]>
I saw that the reporter allowed passing reporter options – since #423.
This PR originally also include a use case: c8 config.
Here is another real world use case:
Unfortunately, the original feature forgot to implement the solution to the exact use case.
SO the actual feature was never accessible/working/existing.
Here is the solution:
reporterOptions
from the config are passed to reporters.I do not have any idea how the CLI could look like to configure this. So I did not implement it and also did not update any docs.
CLI might be like
c8 --reporter-option clover.file=coverage.clover.xml --reporter-option html.subdir=coverage.html
. Or something else.Checklist
npm test
, tests passingnpm run test:snap
(to update the snapshot)