mochawesome
mochawesome copied to clipboard
What does the `stats.other` key in the index.json signify ?
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 ?
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.
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 ?
I do not recall having observed such a case.