Expose test.speed
(or slow
value) in reports (at least JSON)
#4226
Labels
area: node.js
command-line-or-Node.js-specific
area: reporters
involving a specific reporter
status: accepting prs
Mocha can use your help with this one!
type: feature
enhancement proposal
Is your feature request related to a problem or a nice-to-have?? Please describe.
Relative to my purposes to allow precise badge-making from Mocha reporters that takes into account test
speed
/slow
, it is a problem.Describe the solution you'd like
I'd like for
test.speed
to be recorded in JSON results (and/or theslow
value associated with the file as a whole and individual tests).Currently, when I build a badge (here based on a template showing all of the various possible meta-data) from the
mocha-badge-generator
reporter, I can utilize information from a JSON file saved from a Mocha JSON reporter:However, the number of "fast", "medium", and "slow" tests do not take into account whether individual tests allowed for slower speeds (via calls to
this.slow()
) nor does it take into account if the defaultslow
value (of 75ms) was changed for the original tests (I have instead needed to base the notion ofslow
on config repeated at runtime for this after-the-fact badge maker about what constitutes "slow" where I followed your algorithm for considering "medium" as half of "slow").But if I had access to the
slow
value for each test (or whether a test was considered "slow", "medium", or "fast" when the test report was built), I could have my totals take into account expectations by the test makers.In addition to
speed
(orslow
) information,timedOut
(and maybesync
too) would be useful to report also, so that reporters can aggregate information on such test types, counting for example how many tests failed because of timing out.Describe alternatives you've considered
Where tests have to run separate times or otherwise have to act on reports previously generated, there are not really options here that I can think of.
Thanks!
The text was updated successfully, but these errors were encountered: