jest-markdown-expand-reporter is a Jest test reporter that generates detailed test reports in Markdown format. Currently in version 0.1.2-beta, it focuses on providing highly readable and actionable test summaries. Its release cadence appears iterative, driven by beta versions and feature enhancements. Key differentiators include the ability to create expandable sections for individual test results, capture and display per-test console logs (debug, info, error, log, warn), and robust integration with CI/CD pipelines. It supports outputting reports to environment variables using file locking for safe concurrent writes and can generate GitHub Actions workflow annotations for failed tests, significantly improving failure visibility in CI environments. Unlike simpler reporters, it's designed to provide a comprehensive, navigable report suitable for both local review and automated workflows.
npm install jest-markdown-expand-reporterVerified import paths — ran on the pinned version, not inferred.
This configuration snippet for `jest.config.js` demonstrates how to integrate the reporter, patch the console for log capture, and configure various reporting options including output filename, console log types, CI integration, and GitHub annotations.
Always pin to exact versions or test thoroughly when updating within the 0.x.x range.
Add `"setupFilesAfterEnv": ["jest-markdown-expand-reporter/dist/patchConsole.js"]` to your Jest configuration.
Verify that your CI workflow's environment variables are correctly named and accessible, and that the `ciOutput` array in your Jest config matches these names (e.g., `['GITHUB_STEP_SUMMARY']`).
Ensure your tests are running in a GitHub Actions workflow for annotations to appear. Disable `enableAnnotations` if not in GitHub Actions to avoid unnecessary processing.
Run `npm install jest-markdown-expand-reporter` or `yarn add jest-markdown-expand-reporter`. Double-check the spelling in your Jest configuration.
Add `"setupFilesAfterEnv": ["jest-markdown-expand-reporter/dist/patchConsole.js"]` to your `jest.config.js` or `package.json` Jest configuration.
Ensure your CI environment variable (e.g., `GITHUB_STEP_SUMMARY`) is correctly configured and writable. Verify the `ciOutput` option in your Jest config precisely matches the environment variable's name. Check CI job logs for any file locking errors.