You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or a nice-to-have?? Please describe.
At the moment, if mocha.run() is called without any tests having been defined, the result is considered a success as the number of failures is 0. In messageformat/messageformat#261 this is causing a problem when Selenium browser tests are being run in a CI environment using mocha-selenium-bridge, and the tests "pass" (note the IE 11 results):
In our case, this went unnoticed for a number of months as the result was marked as a success. The bug itself was caused by some unsupported-by-IE11 syntax in a test file.
Describe the solution you'd like
I would like to have an option to consider "0 passing" tests to be considered an error.
Describe alternatives you've considered
I could probably write a custom reporter that would catch this, but that seems like a rather clumsy solution. I'm pretty sure the proper place to fix this would be somewhere around here, but the details of course depend on the implementation.
Additional context
I'm willing to submit a PR for this, but I'd rather get feedback first on how e.g. the error code should be handled, and/or whether a separate event would be appropriate for reporters to customise.
The text was updated successfully, but these errors were encountered:
@eemeli There have been issues around this in the past.
From what I understand, requiring a test to be run actually breaks some workflows.
So, the requested behavior, if it were to be added, needs to be opt-in, since it's going to be a breaking change otherwise. This means adding a flag. There are plenty of flags already 😄 so it should be pretty straightforward to figure out where things need to be added.
I'm happy to look at a PR for this; we can sort out the details (e.g., what the flag should be called) later.
If any @mochajs/core object to adding such a flag, please comment.
Is your feature request related to a problem or a nice-to-have?? Please describe.
At the moment, if
mocha.run()
is called without any tests having been defined, the result is considered a success as the number of failures is 0. In messageformat/messageformat#261 this is causing a problem when Selenium browser tests are being run in a CI environment using mocha-selenium-bridge, and the tests "pass" (note the IE 11 results):In our case, this went unnoticed for a number of months as the result was marked as a success. The bug itself was caused by some unsupported-by-IE11 syntax in a test file.
Describe the solution you'd like
I would like to have an option to consider "0 passing" tests to be considered an error.
Describe alternatives you've considered
I could probably write a custom reporter that would catch this, but that seems like a rather clumsy solution. I'm pretty sure the proper place to fix this would be somewhere around here, but the details of course depend on the implementation.
Additional context
I'm willing to submit a PR for this, but I'd rather get feedback first on how e.g. the error code should be handled, and/or whether a separate event would be appropriate for reporters to customise.
The text was updated successfully, but these errors were encountered: