Skip to content

Jest reporter

@brittlehq/jest-reporter plugs into Jest’s reporter slot. Results stream to the hub one spec file at a time. The dashboard fills in progressively rather than waiting for the whole suite to finish.

Terminal window
pnpm add -D @brittlehq/jest-reporter

Add the reporter to jest.config.js (or jest.config.ts):

jest.config.js
module.exports = {
reporters: [
'default',
[
'@brittlehq/jest-reporter',
{
url: process.env.BRITTLE_URL,
token: process.env.BRITTLE_TOKEN,
},
],
],
};

'default' is Jest’s built-in reporter that prints to stdout. Keep it; Brittle’s reporter sits next to it without interaction.

Terminal window
export BRITTLE_URL=https://brittle.your-domain.com
export BRITTLE_TOKEN=brt_svc_xxxxxxxxxxxxxxxx
pnpm test
  • Test result (pass / fail / skipped / todo) plus duration.
  • Full error message + stack trace for any failure.
  • Test environment name (node or jsdom), extracted from Jest’s testEnvironment config and shown on the Session Detail page.
  • The suite path (file + describe-block titles) so the dashboard shows the full breadcrumb, not just the leaf test name.
  • Git commit + branch context, auto-detected.

Results stream per-file as Jest finishes them, so triage can start mid-run on long suites.

  • Snapshot diffs are diff-only, not before/after. Brittle stores the assertion’s error message (which Jest already includes the -Expected/+Received diff in). The actual snapshot file lives in your repo; the reporter doesn’t upload it.
  • testRegex vs testMatch matters. The reporter only knows about tests Jest actually executed. If your config excludes a file, Brittle never sees it.
  • --maxWorkers doesn’t split runs. Always one Run row per jest invocation.

Jest’s reporter accepts every shared option. It has no Jest-specific options.