🚀 Feature: Allow passing in a "target object" for the JSON reporter #5111
Labels
area: reporters
involving a specific reporter
status: in triage
a maintainer should (re-)triage (review) this issue
type: feature
enhancement proposal
Feature Request Checklist
faq
label, but none matched my issue.Overview
Filing an issue for #4822, as described by @ashleyfrieze in #4822. The summary is that in some test setups it's not feasible to have Mocha output to a file.
Suggested Solution
Add to the existing configuration options for the JSON reporter by allowing a target object to be provided to be populated with test results.
Alternatives
We could make a duplicate of the JSON reporter, purely for writing to objects. A workaround is to hack in an alternative of the JSON reporter into the reporters in the runner. However, this is such a small addition to the core, and entirely in keeping with the behaviour of producing a JavaScript model of the test results, that it seems to belong in core.
Additional Info
It's a nice to have feature, and pretty innocuous. I worked around it somehow in my project, but could imagine coming back to this and wanting it in future Java SSR situations, or in situations where some mocha tests are being run by a different test framework as part of a transition plan.
See also previous PR: #2651.
The text was updated successfully, but these errors were encountered: