MCPcopy Index your code
hub / github.com/nodejs/node / collectCoverage

Function collectCoverage

lib/internal/test_runner/harness.js:187–211  ·  view source on GitHub ↗
(rootTest, coverage)

Source from the content-addressed store, hash-verified

185}
186
187function collectCoverage(rootTest, coverage) {
188 if (!coverage) {
189 return null;
190 }
191
192 let summary = null;
193
194 try {
195 summary = coverage.summary();
196 } catch (err) {
197 rootTest.diagnostic(`Warning: Could not report code coverage. ${err}`);
198 rootTest.harness.success = false;
199 process.exitCode = kGenericUserError;
200 }
201
202 try {
203 coverage.cleanup();
204 } catch (err) {
205 rootTest.diagnostic(`Warning: Could not clean up code coverage. ${err}`);
206 rootTest.harness.success = false;
207 process.exitCode = kGenericUserError;
208 }
209
210 return summary;
211}
212
213function setupFailureStateFile(rootTest, globalOptions) {
214 if (!globalOptions.rerunFailuresFilePath) {

Callers

nothing calls this directly

Calls 3

summaryMethod · 0.45
diagnosticMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…