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

Mocha Json reporter references the incorrect variable for reporterOptions #4741

Closed
KamalAman opened this issue Sep 7, 2021 · 5 comments
Closed
Labels
invalid not something we need to work on, such as a non-reproducing issue or an external root cause

Comments

@KamalAman
Copy link

KamalAman commented Sep 7, 2021

The reporter references are variable called reporterOption however there is no such thing, it is reporterOptions with an s at the end of it

if (options.reporterOption && options.reporterOption.output) {

Added in 4607
Requested in 4131

@juergba
Copy link
Member

juergba commented Sep 7, 2021

@juergba juergba added the invalid not something we need to work on, such as a non-reproducing issue or an external root cause label Sep 7, 2021
@KamalAman
Copy link
Author

KamalAman commented Sep 7, 2021

@juergba Interesting, yeah things seem to be inconsistent. While mocha.js does define reporterOption no other reporter actually uses that.

These 3 reporters use reporterOptions

var reporterOptions = options.reporterOptions || {};

if (options && options.reporterOptions) {

if (options && options.reporterOptions) {

@juergba juergba closed this as completed Sep 7, 2021
@KamalAman
Copy link
Author

@juergba please reopen, see my comment above

Another FYI, Cypress has also integrated with reporterOptions and not reporterOption
https://github.com/cypress-io/cypress/blob/a6a2c49c353d692e0009018a3fa186f164bc4730/packages/server/lib/reporter.js#L293

@juergba
Copy link
Member

juergba commented Sep 7, 2021

It works with the canonical name reporterOptionand its alias name reporterOptions, with both names.
You haven't really tested,right?

@KamalAman
Copy link
Author

KamalAman commented Sep 7, 2021

I have with Cypress. Since it should be an alias parameters, then Cypress has a bug with their integration.
Thanks

chammond-tz added a commit to chammond-tz/cypress-plugins that referenced this issue Oct 19, 2023
…reportOptions` to match expectations in mocha

This resolves issues with being unable to pass options to reporters complying with the newer `reportOption` name, as noted here: mochajs/mocha#4741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid not something we need to work on, such as a non-reproducing issue or an external root cause
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants