-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add reporter options example #4225
Conversation
We know you spent your time to figure this out, but this example configs aren't for explaining every option. |
I know that, but what was surprising for me was the format. I was expecting to pass params like: reporterOptions: {
suiteName: "My Tests",
output: "./build/tests.xml"
} like its displayed across all the documentation, while instead, mocha expected this: 'reporter-options': [
'suiteName="My Tests"',
'output=./build/tests.xml'
], This was very confusing for me and I guess it would be good to have it in those examples. Especially your other examples are much larger: https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml I can change the example to be more generic like in What you think? |
@juergba @tj @boneskull what do you think? |
IMO it is rather confusing, see eg. #4142. |
My point exactly! There is no clear documentation about it, or at least I could not find it. However there is plenty documentation for passing an object to the constructor. That’s why I strongly believe that adding example from this PR would help people... Validation of mocharc structure would help too, but that’s a separate topic... |
I understood what @pkuczynski pointed out. And I realized our .mocharc.yml is much verbose than others. |
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.
IMO, if we add this in our configuration examples, we should add them into .mocharc.json
and .mocharc.jsonc
as well not only .mocharc.json
.
I can do that tonight if you want? |
I just updated my PR to align with |
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.
@pkuczynski Thank you, I have some comments.
- none of your commits did pass our CI tests
- use the canonical option name
reporter-option
instead of its alias - there is no need to align with .mocharc.yml, please revert this change
- .mocharc.js: your first commit is ok, just watch out for the option name and linting errors
- .mocharc.json: align with .mocharc.js. Please remove the four comment lines
- .mocharc.jsonc: align with .mocharc.js
- remove
// Camel-casing options are also accepted
. The parsing of camel-cased option is buggy in certain edge cases. - change
watchFiles
towatch-files
- change
watchIgnore
towatch-ignore
- remove
I have not modified anything else than I suggest updating other files in a separate PR once we align on |
Build is finally green now :) |
thanks!! |
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.
I suggest updating other files in a separate PR once we align on .mocharc.js
Agreed.
IMO there isn't any reason we don't align with yaml
for js
.
Thank you.
@juergba can you pls confirm your comments have been addressed; if so please merge |
and by merge i mean "squash" |
… kunnen zien (#203) * Initial commit * Voeg npm run script toe * Voeg path toe als dep en move build naar scripts folder * Refactor * Fix regex * Refactor en toevoegen unit tests * Refactor en unit testen * Voeg wct-xunit dep toe * Verplaats wct-xunit van devDependencies naar dependencies Enable wct-xunit plugin in wct.local.conf * Configure reporter via mocharc * Geef reporter options door als array cfr mochajs/mocha#4225 * Fix pad naar result xml * Config finetuning * Installeer wct-mocha * Verwijder wct-mocha (testen wilden niet meer runnen) en voeg wct-junit-converter als plugin toe * Gebruik wct-xunit-reporter * Fix paden * Maak gitignore uniform en kopieer naar component * Bugfix * Bugfix * Bugfix * Bugfix * Bugfix * Bugfix * Bugfix * Kopieer gitignore en npmignore via templates omdat .gitignore en .npmginore niet in de gereleasde versie zitten * copyfiles vervangen door cp * Maak test result folder aan * Verwijder intermediate folder results omdat de xunit plugin geen folders aanmaakt * Verwijder intermediate folder results omdat de xunit plugin geen folders aanmaakt * gitignore update * Vervang rsync oplossing in docker-compose door gebruik te maken van dockerignore * bugfix * Expose test resultaten naar Bamboo * Expose test resultaten naar Bamboo * Merge with master Co-authored-by: cambiph <philippe.cambien@gmail.com>
Hi folks ! Just checking in to say that this PR helped me understand how Any plans to merge this soon ? I think it could help a lot of people. Cheers ! :) |
I tried to add reporter options as `reporterOptions` or `reporterOption` and failed miserably for quite a while until I accidentally found out that it needs to be specified like in the example below. I think it's worth adding an example to the documentation to save other people's time.
Description of the Change
I tried to add reporter options as
reporterOptions
orreporterOption
and failed miserably for quite a while until I accidentally found out that it needs to be specified like in the example below.Benefits
I think it's worth adding an example to the documentation to save other people's time.