function updateCounter
updateCounter(
counter: Counter,
details: TestDetails
): void

Applies one testEnd to the run's counters. Kept separate from any reporter so the numbers are identical no matter which reporter (or how many) is active — the exit code and the TAP plan both read counter, so it must be updated exactly once per test.

const counter = { total: 0, failed: 0, skipped: 0, todo: 0, passed: 0, assertionsFailed: 0 };
updateCounter(counter, { status: 'passed', fullName: ['Math', 'adds'], runtime: 2 });
counter.total; // 1
counter.passed; // 1

Parameters

counter: Counter
details: TestDetails

Return Type

void

Usage

import { updateCounter } from "lib/reporters/types.ts";