type Reporter = ReporterName | [ReporterName, ReporterOptions];
type Reporters = Reporter | Reporter[];process.env.GITHUB_ACTIONS === 'true'
? ['default', 'github-actions']
: ['default'];--reporter=<name> --reporter=<name1>Customize the reporter type.
By default, Rstest displays test run status, results, and summary information in the terminal.
Output example:
✓ test/index.test.ts (2)
Test Files 1 passed
Tests 2 passed
Duration 112ms (build 19ms, tests 93ms)The default reporter only outputs test case information when tests fail or run slowly. The verbose reporter will output all test case information after test completion.
npx rstest --reporter=verboseWith verbose reporter, Rstest outputs:
✓ test/index.test.ts (2) 2ms
✓ Index > should add two numbers correctly (1ms)
✓ Index > should test source code correctly (1ms)
Test Files 1 passed
Tests 2 passed
Duration 112ms (build 19ms, tests 93ms)The GitHub Actions reporter outputs error messages in the form of workflow commands when tests fail.
When tests fail, the GitHub Actions reporter outputs information in a format similar to:
::error file=src/index.ts,line=4,col=17,title=test/index.test.ts > should add two numbers correctly::expected 2 to be 4These outputs are parsed by GitHub Actions and generate comments at the corresponding locations.

When no reporter is manually set, Rstest automatically enables this reporter when it detects a GitHub Actions environment (process.env.GITHUB_ACTIONS is 'true').
You can also manually enable this reporter:
npx rstest --reporter=github-actionsThe JUnit reporter supports outputting test reports in JUnit XML format, making it easy to integrate with CI/CD.
npx rstest --reporter=junitoutputPath: Configure the output path for the report. If not specified, it will output to the console.import { defineConfig } from '@rstest/core';
export default defineConfig({
reporters: [['junit', { outputPath: './junit.xml' }]],
});The JUnit reporter generates XML format as follows:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="rstest tests" tests="3" failures="1" errors="1" skipped="1" time="0.3" timestamp="2024-01-01T00:00:00.000Z">
<testsuite name="test1.test.ts" tests="3" failures="1" errors="1" skipped="1" time="0.3" timestamp="2024-01-01T00:00:00.000Z">
<testcase name="should pass" classname="test1.test.ts" time="0.1">
</testcase>
<testcase name="should fail" classname="test1.test.ts" time="0.2">
<failure message="Test failed" type="AssertionError">expected 'hi' to be 'hii' // Object.is equality - Expected + Received - hii + hi at test1.test.ts:10:21</failure>
</testcase>
<testcase name="should skip" classname="test1.test.ts" time="0.0">
<skipped/>
</testcase>
</testsuite>
</testsuites>The JUnit reporter maps test case execution status to JUnit test status:
pass: Test passedfail: Test failed, generates <failure> tagskip: Test skipped, generates <skipped> tagtodo: Test todo, generates <skipped> tag