Skip to content

Conversation

danielrentz
Copy link
Contributor

@danielrentz danielrentz commented Sep 24, 2025

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:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@kobenguyent kobenguyent requested a review from Copilot September 24, 2025 08:11
Copy link
Contributor

@Copilot Copilot AI left a 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 just codeceptjs 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.

@kobenguyent
Copy link
Collaborator

@danielrentz I'm not sure about this change, perhaps @DavertMik could advise on this.

@DavertMik
Copy link
Contributor

@danielrentz I think both options are correct and there are situations where both can be nice to have
So I would better show all alternatives if possible

@danielrentz
Copy link
Contributor Author

danielrentz commented Oct 6, 2025

@kobenguyent @DavertMik

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 npm run docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants