adamgruber / mochawesome

A Gorgeous HTML/CSS Reporter for Mocha.js
https://gitter.im/mochawesome/general
MIT License
1.06k stars 160 forks source link

What does the `stats.other` key in the index.json signify ? #390

Open atharvasune opened 1 year ago

atharvasune commented 1 year ago

Hi, I have a project that uses mochawesome for report generation. We parse the index.json that is generated for some analysis, and I just wanted to understand what does the other key under stats mean ? I went through mochawesome.js file and found this

obj.stats.other = passes + failures + pending - tests; // Failed hooks
obj.stats.hasOther = obj.stats.other > 0;
obj.stats.skipped = testTotals.skipped;
obj.stats.hasSkipped = obj.stats.skipped > 0;
obj.stats.failures -= obj.stats.other;

So is it safe to assume that other is similar to failures ?

adamgruber commented 1 year ago

Hi. As stated in the comment, it refers to any hooks that have failed. For example, if some code inside a before() call throws an error that would be reported in other.

atharvasune commented 1 year ago

Got it. One more thing I am trying to understand is, could there be a case, where other > 0 but all tests have passed ? @adamgruber , have you observed any such cases ?

adamgruber commented 1 year ago

I do not recall having observed such a case.