Docs · API reference · Motus.Abstractions
ICoverageReporter Interface#
Opt-in reporter interface for receiving JavaScript and CSS code coverage data collected during test execution. Reporters implement both IReporter and ICoverageReporter to receive coverage events. Separate from IReporter to avoid default interface methods, which conflict with NativeAOT trimming.
public interface ICoverageReporter
Methods#
OnCoverageCollectedAsync(CoverageData, TestInfo) Method#
Called when coverage data has been collected for a single test.
System.Threading.Tasks.Task OnCoverageCollectedAsync(Motus.Abstractions.CoverageData coverage, Motus.Abstractions.TestInfo test);
Parameters#
coverage CoverageData
The collected coverage snapshot for this test.
test TestInfo
The test that produced the snapshot.
Returns#
OnCoverageRunEndAsync(CoverageData) Method#
Called once at the end of the test run with the aggregated coverage data merged across all tests. This is the hook for run-level reports (console summary, HTML report, Cobertura XML).
System.Threading.Tasks.Task OnCoverageRunEndAsync(Motus.Abstractions.CoverageData aggregated);
Parameters#
aggregated CoverageData
Coverage data merged across the entire run.