Skip to content

Jest reporter options

In jest.config.js or jest.config.mjs:

export default {
reporters: [
'default',
[
'executable-stories-jest/reporter',
{
/* options */
},
],
],
setupFilesAfterEnv: ['executable-stories-jest/setup'],
};

The reporter uses FormatterOptions from executable-stories-formatters. Same core options as Vitest reporter options, plus Jest’s own setupFilesAfterEnv requirement.

OptionTypeDefaultDescription
formatsOutputFormat[]["cucumber-json"]Output formats: "markdown", "html", "junit", "cucumber-json", "cucumber-messages", "cucumber-html".
outputDirstring"reports"Base directory for output files.
outputNamestring"test-results"Base filename (without extension).
outputNameTimestampbooleanfalseAppend a UTC timestamp suffix to the output filename.
outputOutputConfig{ mode: "aggregated" }Output routing configuration.
rawRunPathstringWrite the raw run JSON to disk for later CLI use.
FieldTypeDefaultDescription
mode"aggregated" | "colocated""aggregated"Single file vs one file per source.
colocatedStyle"mirrored" | "adjacent""mirrored"Colocated: mirrored under outputDir or next to source file.
rulesOutputRule[][]Pattern-based overrides (first match wins).

Nested under markdown. See Vitest config for full list.

The same top-level filtering, history, and notification options are also available in Jest reporter config.

[
'executable-stories-jest/reporter',
{
formats: ['markdown'],
outputDir: 'docs',
outputName: 'user-stories',
output: { mode: 'aggregated' },
markdown: {
title: 'User Stories',
includeStatusIcons: true,
includeMetadata: true,
},
},
];
[
'executable-stories-jest/reporter',
{
formats: ['markdown', 'html', 'cucumber-json'],
outputDir: 'reports',
outputName: 'test-results',
output: { mode: 'aggregated' },
},
];
[
'executable-stories-jest/reporter',
{
formats: ['markdown'],
outputDir: 'docs',
output: {
mode: 'colocated',
colocatedStyle: 'mirrored',
},
},
];