class DotReporter
implements Reporter

One character per test, failures reported in full at the end. The right shape for large suites and CI logs, where a line per test is thousands of lines of noise but you still want live progress.

Unlike spec, failure detail is buffered rather than printed inline — interleaving failure blocks with the dot matrix would break the matrix apart and lose the at-a-glance shape.

import type { ReporterContext } from './types.ts';

import type { TestDetails } from './types.ts';

// Defined, not invoked: streams the dot matrix to stdout.
function example(context: ReporterContext, details: TestDetails) {
  const reporter = new DotReporter();
  reporter.onRunStart(context, { fileCount: 3, groupCount: 2 });
  reporter.onTestEnd(context, details); // one character per test: . F t s
  reporter.onRunEnd(context, { durationMs: 1200 }); // counts + buffered failure blocks
}

Methods

onRunEnd(): void

Closes the matrix line, then prints the counts and every buffered failure.

import type { ReporterContext } from './types.ts';

// Defined, not invoked: reads context.counts and writes to stdout.
function example(reporter: DotReporter, context: ReporterContext) {
  reporter.onRunEnd(context, { durationMs: 1200 }); // "  12 passing (1200ms)" + failure recap
}

Resets the matrix column and buffered failures, then prints the run banner.

import type { ReporterContext } from './types.ts';

// Defined, not invoked: prints the banner to stdout.
function example(context: ReporterContext) {
  new DotReporter().onRunStart(context, { fileCount: 3, groupCount: 2 });
  // "Running 3 test files across 2 worker(s)"
}
onTestEnd(
context: ReporterContext,
details: TestDetails
): void

Writes this test's character, wrapping the matrix, and buffers any failure detail.

import type { ReporterContext } from './types.ts';

// Defined, not invoked: writes one status character to stdout.
function example(reporter: DotReporter, context: ReporterContext) {
  reporter.onTestEnd(context, { status: 'passed', fullName: ['Math', 'adds'], runtime: 2 }); // '.'
  reporter.onTestEnd(context, { status: 'skipped', fullName: ['Math', 'later'], runtime: 0 }); // 's'
}

Usage

import { DotReporter } from "lib/reporters/dot.ts";