Skip to content
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

Philosophical Reporter Questions #3537

Closed
plroebuck opened this issue Oct 28, 2018 · 3 comments
Closed

Philosophical Reporter Questions #3537

plroebuck opened this issue Oct 28, 2018 · 3 comments
Labels
area: reporters involving a specific reporter type: discussion debates, philosophy, navel-gazing, etc.

Comments

@plroebuck
Copy link
Contributor

Full Disclosure: Yes, I know the terminal codes will interfere with certain file formats.

  • An upcoming change to the xunit reporter intentionally turns use of color off. If a user issues the command below, were his expections met?
$ FORCE_COLOR=1 mocha --reporter xunit
  • Should a reporter be able to completely disregard a user setting? If so, should it warn?

If the command line had been that below, I could see not bothering since file output was specified.

$ FORCE_COLOR=1 mocha --reporter xunit --reporter-options output=xunit.xml

While not currently implemented, I could also see reporter that outputs to both file and console.
For instance, the above could also echo any failed tests to console (via reporter option, of course)

@plroebuck plroebuck added area: reporters involving a specific reporter type: question support question labels Oct 28, 2018
@mlucool
Copy link
Contributor

mlucool commented Oct 28, 2018

I agree this should either warn or throw.

I could also see reporter that outputs to both file and console.

I have implemented something similar in my code, but the reporter for console is spec and the output for file is xunit because spec is great for people and xunit is great for machines.

@plroebuck
Copy link
Contributor Author

Ramon has some interesting additions in his xunit reporter, specifically his properties and console output. I think almost everyone would agree that xunit is not the format format for humans. But when you're saving the output to file, it still might be nice to know (on console) whether errors have occurred.

@boneskull
Copy link
Contributor

  • We can safely output warnings to STDERR while the test output stays in STDOUT.
  • If there's a valid use case for machine-readable reporters to output in color, then we can support such a thing if someone wants it, but I don't believe there is.
  • I'm 👎 on a warning if FORCE_COLOR or --color is used with a machine-readable output format. I can see a situation in which it'd create extra work for developers to avoid/suppress the warning--like if it's conflicting with other defaults (e.g., mocha.opts).

@boneskull boneskull added type: discussion debates, philosophy, navel-gazing, etc. and removed type: question support question labels Nov 5, 2018
@juergba juergba closed this as completed Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: reporters involving a specific reporter type: discussion debates, philosophy, navel-gazing, etc.
Projects
None yet
Development

No branches or pull requests

4 participants