M00N ReportJest JS/TS
Documentation/Reporters/Jest

🃏Jest Reporter

A Jest reporter for M00N Report. Streams results to the dashboard in real time, mirrors describe hierarchies as folders, tracks jest.retryTimes attempts independently, and surfaces snapshot statistics on the run summary. Requires Jest 27 or later.

Features

Real-Time Streaming

Test results stream to the dashboard via WebSocket as each test completes.

Auto-Organization

describe blocks map to folder hierarchy; nested describes nest.

Retry Support

Each jest.retryTimes attempt is recorded as a separate execution.

Parallel Runs

Thread-safe across Jest's parallel worker processes.

Snapshot Tracking

Reports added, updated, unmatched, and obsolete snapshot counts per run.

Watch Mode

Each watch trigger opens a new launch; previous launches stay in history.

Console Output

Optionally captures console.log/warn/error per test.

AI Setup Prompt

A complete, self-contained prompt for integrating this reporter into an existing Jest project using an AI assistant. The prompt covers installation, the canonical jest.config.js form, ES Modules and package.jsonvariants, environment-variable overrides, a verification checklist, and the most common integration pitfalls.

Store the API key outside version control. Read it from process.env.M00N_API_KEY in jest.config.js and supply it as a CI secret; never hard-code it in package.json.

Configuration Reference

OptionTypeDefaultDescription
serverUrlstring-Required. M00N ingest service URL
apiKeystring-Required. Project API key (identifies org and project)
launchstring-Custom name for this test run
tagsstring[][]Array of tags for this run
attributesobject{}Custom key-value metadata; CI-related keys are picked up by the CI banner
debugbooleanfalseVerbose reporter logging
realtimebooleantrueStream per-test results over WebSocket as they complete
includeConsolebooleanfalseCapture console.log/warn/error and attach to each test
includeCoveragebooleanfalseInclude the coverage summary (requires Jest itself to collect coverage)
includeSnapshotsbooleantrueInclude snapshot statistics on the run summary
slowTestThresholdnumber5000Threshold in ms for marking tests as slow

CI/CD Context Banner

When you pass CI/CD-related attribute keys, M00N Report automatically displays them in a dedicated CI context banner at the top of the launch view. Any attributes that don't match the keys below are shown as regular attribute badges.

Recognized CI Attribute Keys

Banner FieldAccepted Keys (case-insensitive)Example Value
Pipelinepipeline, GITHUB_WORKFLOW, CI_PIPELINE_NAME, JOB_NAMEDeploy Production
Branchbranch, git_branch, GITHUB_REF, CI_COMMIT_REF_NAME, BRANCH_NAMEmain
Commitcommit, git_commit, GITHUB_SHA, CI_COMMIT_SHA, GIT_COMMITa1b2c3d (truncated to 7 chars)
Build #build_number, GITHUB_RUN_NUMBER, CI_PIPELINE_ID, BUILD_NUMBER1234
Build URLbuild_url, GITHUB_SERVER_URL, CI_PIPELINE_URL, BUILD_URLhttps://github.com/... (clickable)
Environmentenvironment, env, DEPLOY_ENVstaging
Triggertrigger, GITHUB_EVENT_NAME, CI_PIPELINE_SOURCEpush
Tip: You can use any of the accepted key names. For example, both branch and GITHUB_REF will display in the Branch field of the CI banner. Only the first match per field is used.

Concepts

Reference documentation for each subsystem of the reporter: attachments, retry handling, auto-organization, snapshot tracking, console capture, watch mode, configuration sources, and troubleshooting.