-
-
Notifications
You must be signed in to change notification settings - Fork 750
Update reports.md: use "reporter" option instead of CLI #5211
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
base: 3.x
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
Updates documentation examples to use the "reporter"
configuration option in codecept.config.js
instead of the CLI --reporter
flag, ensuring consistency between reporter configuration and options.
- Adds
"reporter"
field to JSON configuration examples for JUnit, Mochawesome, and mocha-multi reporters - Removes CLI
--reporter
flags from execution examples, simplifying commands to justcodeceptjs run
- Updates execution instructions to reflect the configuration-driven approach
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@danielrentz I'm not sure about this change, perhaps @DavertMik could advise on this. |
@danielrentz I think both options are correct and there are situations where both can be nice to have |
Thanks for your feedback. I changed the PR to add the config-only variant as an alternative below the original docs. The PR contains an additional typo fix in the Mochawecome chapter (copy/pasted "HTML" from above instead of "mochawesome"). The remaining changes in the file are caused by the generator script |
Motivation/Description of the PR
In
docs/reports.md
, the examples for Mocha reporter configurations should use the"mocha":{"reporter":"..."}
option in codecept.config.js instead of the--reporter
CLI option to point out that a reporter is always tied to its options.This eliminates the risk that users forget to specify the correct reporter at some place (package.json scripts, CI scripts, ...).
It is pointless anyway to put the options of one reporter into the config file, and to specify another reporter in the CLI. This may even cause errors/exceptions from the running reporter if it sees invalid config options in the file (seen with mocha-multi).
Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)