Bun

Node.js module

node:test/reporters

The 'node:test/reporters' module provides built-in reporter formats for node:test, such as tap, json, and baseline. Reporters format test results for human or machine consumption.

Use reporters to integrate with CI systems, test dashboards, or custom logging pipelines.

  • const lcov: LcovReporter
  • const spec: ReporterConstructorWrapper<typeof SpecReporter>

    The spec reporter outputs the test results in a human-readable format.

  • function dot(
    source: TestEventGenerator
    ): AsyncGenerator<' ' | '.' | 'X', void>;

    The dot reporter outputs the test results in a compact format, where each passing test is represented by a ., and each failing test is represented by a X.

  • function junit(
    source: TestEventGenerator
    ): AsyncGenerator<string, void>;

    The junit reporter outputs test results in a jUnit XML format.

  • function tap(
    source: TestEventGenerator
    ): AsyncGenerator<string, void>;

    The tap reporter outputs the test results in the TAP format.

Type definitions

  • type TestEvent = { data: TestCoverage; type: 'test:coverage' } | { data: TestComplete; type: 'test:complete' } | { data: TestDequeue; type: 'test:dequeue' } | { data: DiagnosticData; type: 'test:diagnostic' } | { data: TestEnqueue; type: 'test:enqueue' } | { data: TestFail; type: 'test:fail' } | { data: TestPass; type: 'test:pass' } | { data: TestPlan; type: 'test:plan' } | { data: TestStart; type: 'test:start' } | { data: TestStderr; type: 'test:stderr' } | { data: TestStdout; type: 'test:stdout' } | { data: TestSummary; type: 'test:summary' } | { data: undefined; type: 'test:watch:drained' }