For AI agents: the complete documentation index is available at https://rstest.rs/llms.txt, the full documentation bundle is available at https://rstest.rs/llms-full.txt, and this page is available as Markdown at https://rstest.rs/config/test/reporters.md.
close
  • English
  • reporters

    • Type:
    type ReporterItem =
      | Reporter
      | BuiltInReporterNames
      | (string & {})
      | ReporterWithOptions
      | [string]
      | [string, Record<string, unknown>];
    
    type Reporters =
      Reporter | BuiltInReporterNames | (string & {}) | ReporterItem[];
    • Default:
    process.env.GITHUB_ACTIONS === 'true'
      ? ['default', 'github-actions']
      : ['default'];
    • CLI: --reporters=<name> --reporters=<name1> (--reporter is also accepted as an alias)

    Configure which reporters to use for test result output.

    Built-in reporter names: default, dot, verbose, md, github-actions, junit, json, and blob.

    This is a global option set in the root config and cannot be overridden per project in projects.

    AI agent environments

    When no reporters are configured (neither in config nor via --reporters), Rstest defaults to ['md'] in AI agent environments and writes agent-friendly Markdown to stdout.

    Usage

    Basic example

    CLI
    rstest.config.ts
    npx rstest --reporters=default

    Multiple reporters

    Pass an array to combine console output with file reports for CI/CD pipelines:

    CLI
    rstest.config.ts
    npx rstest --reporters=default --reporters=junit

    Configuring reporters with options

    Pass [reporterName, options] inside the reporters array to configure a reporter. See the Reporters guide for each built-in reporter's available options:

    rstest.config.ts
    import { defineConfig } from '@rstest/core';
    
    export default defineConfig({
      reporters: [
        ['default', { summary: false }],
        ['github-actions', { summary: { maxCharsPerField: 1000 } }],
        ['junit', { outputPath: './test-results.xml' }],
      ],
    });

    Custom reporters

    Pass a module specifier (or [specifier, options]) whose default export is a class implementing Reporter, or pass an already constructed Reporter object directly (reporter classes cannot be passed directly). See the Reporter API reference for the Reporter interface, constructor signature, and TypeScript support.