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

Function countCompletedTest

lib/internal/test_runner/utils.js:457–484  ·  view source on GitHub ↗
(test, harness = test.root.harness)

Source from the content-addressed store, hash-verified

455}
456
457function countCompletedTest(test, harness = test.root.harness) {
458 if (test.nesting === 0) {
459 harness.counters.topLevel++;
460 }
461 if (test.reportedType === 'suite') {
462 harness.counters.suites++;
463 if (!test.passed && !test.isTodo) {
464 harness.success = false;
465 }
466 return;
467 }
468 // Check SKIP and TODO tests first, as those should not be counted as
469 // failures.
470 if (test.skipped) {
471 harness.counters.skipped++;
472 } else if (test.isTodo) {
473 harness.counters.todo++;
474 } else if (test.cancelled) {
475 harness.counters.cancelled++;
476 harness.success = false;
477 } else if (!test.passed) {
478 harness.counters.failed++;
479 harness.success = false;
480 } else {
481 harness.counters.passed++;
482 }
483 harness.counters.tests++;
484}
485
486
487const memo = new SafeMap();

Callers 2

#handleReportItemMethod · 0.85
reportMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…