Registry / testing / jest-markdown-expand-reporter

jest-markdown-expand-reporter

JSON →
library0.1.2-betajsnpmunverified

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-reporter
INSTALL
IMPORT
SIG · JEST-MARKDOWN-EXPA
J
jest-markdown-expand-reporter
testingjavascriptv0.1.2-beta
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Jest Reporter Configuration
["jest-markdown-expand-reporter", { /* options */ }]
"jest-markdown-expand-reporter"
When configuring in `jest.config.js` or `package.json`, the reporter is specified as a string name. If you need to pass options, it must be an array where the first element is the string name and the second is an options object.
Console Patch Utility
jest-markdown-expand-reporter/dist/patchConsole.js
jest-markdown-expand-reporter/patchConsole.js
This path is used in `setupFilesAfterEnv` to patch Jest's console object, enabling the reporter to capture and display console logs for each test. Forgetting the `dist/` subdirectory is a common oversight.

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.

{ "jest": { // To capture console logs in the output "setupFilesAfterEnv": ["jest-markdown-expand-reporter/dist/patchConsole.js"], "reporters": [ [ "jest-markdown-expand-reporter", { "filename": "test-report.md", "publicPath": "./test-reports", "displayAll": true, "failureMessages": true, "consoleLogs": ["all"], // Can be ['log', 'error', 'warn', 'info', 'debug'] or ['all'] "ciOutput": ["GITHUB_STEP_SUMMARY"], // e.g., for GitHub Actions step summary "enableAnnotations": true, // Enables GitHub Actions annotations for failures "skipDisplayIfNoFailures": true, "prioritizeFailures": true } ] ] } }
Debug
Known issues
breakingThe package is currently in a beta version (0.1.2-beta). Future releases, even minor ones, may introduce breaking changes or significant API adjustments before a stable 1.0.0 release.
fix
Always pin to exact versions or test thoroughly when updating within the 0.x.x range.
affects: <1.0.0
gotchaFor console logs to be captured and displayed in the report, you MUST include `jest-markdown-expand-reporter/dist/patchConsole.js` in your `setupFilesAfterEnv` configuration array.
fix
Add `"setupFilesAfterEnv": ["jest-markdown-expand-reporter/dist/patchConsole.js"]` to your Jest configuration.
affects: >=0.0.1
gotchaWhen using `ciOutput`, the reporter writes to specified environment variables (e.g., `GITHUB_STEP_SUMMARY`). Ensure the CI environment allows writing to these variables and that the specified environment variables exist and are correctly configured for your CI provider.
fix
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']`).
affects: >=0.0.4
gotchaThe `enableAnnotations` option only functions within GitHub Actions workflows. Enabling it in other CI environments or locally will have no effect on output annotations.
fix
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.
affects: >=0.1.0-beta
Errors
Common errors & fixes
Error: Reporter 'jest-markdown-expand-reporter' not found.
The reporter package is not installed, or there's a typo in the reporter name in `jest.config.js`.
fix
Run `npm install jest-markdown-expand-reporter` or `yarn add jest-markdown-expand-reporter`. Double-check the spelling in your Jest configuration.
Console logs are not appearing in the report despite setting `consoleLogs` to 'all'.
The `patchConsole.js` setup file, which is responsible for intercepting console calls, has not been included in Jest's `setupFilesAfterEnv`.
fix
Add `"setupFilesAfterEnv": ["jest-markdown-expand-reporter/dist/patchConsole.js"]` to your `jest.config.js` or `package.json` Jest configuration.
My `ciOutput` environment variable is empty or contains an old report after a new run.
This could happen if file locking failed or the CI environment variable isn't correctly configured to receive output.
fix
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.
Upgrade
Version history
0.1.2-betalatest on npm
Audit
Dependencies
jestrequiredThis package is a Jest reporter and requires Jest as a peer dependency to function. It integrates directly with Jest's test runner.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
jest-markdown-expand-reporter — npm install jest-markdown-expand-reporter · libregistry