Installation (Jest)
Install the packages
Section titled “Install the packages”pnpm add -D jest executable-stories-jest executable-stories-formattersOr with npm:
npm install -D jest executable-stories-jest executable-stories-formattersAdd the reporter
Section titled “Add the reporter”In jest.config.js (or jest.config.mjs), add the Story reporter and setup:
export default { // ... your existing config setupFilesAfterEnv: ['executable-stories-jest/setup'], reporters: [ 'default', [ 'executable-stories-jest/reporter', { formats: ['markdown'], outputDir: 'docs', outputName: 'user-stories', output: { mode: 'aggregated' }, }, ], ],};Default output
Section titled “Default output”With the option above, the reporter writes to docs/user-stories.md. Run your tests:
pnpm jestThe Markdown file is generated after the test run.
First Story (Jest) — write your first scenario.
Jest reporter options — all configuration options.