feat: support passing reporter options from config#459
Conversation
Contributor
Author
|
rebased onto target branch, fixed conflicts, updated snap @bcoe ping |
bcoe
approved these changes
Nov 21, 2023
bcoe
reviewed
Jan 3, 2024
| excludeAfterRemap: argv.excludeAfterRemap, | ||
| reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter], | ||
| reportsDirectory: argv['reports-dir'], | ||
| reporterOptions: argv.reporterOptions || {}, |
Owner
|
@jkowalleck apologies for ignoring this for so long, bother you to implement the suggestion. |
Contributor
Author
My current code reflects existing style. |
Owner
|
@jkowalleck your branch has conflicts, could I bother you to rebase and push. |
Contributor
Author
|
will recreate the test snapshots during next week. |
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Contributor
Author
|
@bcoe rebased onto main and recreated test snaps |
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
mcknasty
pushed a commit
to mcknasty/c8
that referenced
this pull request
Feb 2, 2024
This was referenced Sep 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
{ "all": true, "reporter": ["text-summary", "clover", "html"], "reporterOptions": { "clover": {"file": "coverage.clover.xml"}, "html": {"subdir": "coverage.html"} }, "reports-dir": "./reports", "temp-directory": "./.c8.cache" }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:
reporterOptionsfrom 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)