jest-junit

A Jest reporter that converts test results into JUnit-compatible XML for CI dashboards and test-analytics tools.

Tool
npm
v17.0.0
502 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
62 /100 Good
Development Activity 56
Maintenance 48
Community 64
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
60 /100 Good
Architecture 68
Code Quality 68
Innovation 65
Learning Curve 40

jest-junit is the de facto standard reporter for turning Jest test output into JUnit XML, the format most CI dashboards and test-analytics platforms expect. Rather than parsing Jest’s console output, CI pipelines add jest-junit to the reporters array and get a structured junit.xml file with per-suite and per-test timing, failure messages, and pass/fail/skip counts.

Beyond the default output, jest-junit exposes fine-grained control over naming (via {classname}, {title}, {filepath} templates or custom functions), lets teams inject arbitrary <property> metadata for downstream tools like Datadog CI Visibility, and supports monorepo-friendly path prefixing and unique output filenames for parallel/sharded test runs.

What You Get

  • A drop-in Jest reporter that outputs junit.xml for immediate CI integration, with no custom scripting required.
  • Full control over how suite, test, and class names render via template strings or callback functions.
  • Hooks for attaching custom <properties> metadata to test suites and individual test cases.
  • Configuration through three layers (defaults, package.json, environment variables) so teams can override behavior per environment without code changes.

Common Use Cases

  • Feeding Jest results into CI systems that expect JUnit XML (Jenkins, GitLab CI, CircleCI, Bitbucket Pipelines).
  • Aggregating test reports across multiple packages in a monorepo test run.
  • Enriching test reports with vendor-specific metadata for test-analytics tools like Datadog CI Visibility.

Under The Hood

Architecture index.js exports a constructor function that supports both the legacy testResultsProcessor API (invoked statically) and the modern reporters API (invoked via new), delegating to an internal processor() that merges options via getOptions.options() and hands Jest’s aggregated result object to utils/buildJsonResults.js, which produces a nested JSON structure mirroring the JUnit schema (testsuites -> testsuite -> testcase). That structure is serialized to XML by the xml package and written to disk with fs.writeFileSync. An onTestResult hook buffers per-file console output so it can be attached during onRunComplete. The whole codebase is a small, flat set of single-purpose modules (index.js plus utils/ and constants/) rather than a layered architecture, and every templating and custom-property feature depends on the variable-substitution scheme defined once in buildJsonResults.js — a change there ripples through classname/title/suitename templating and the custom-properties injection points alike.

Tech Stack Plain Node.js (engines >=20) with no build step, shipped as CommonJS. Runtime dependencies are minimal and purpose-built: xml for JSON-to-XML serialization, strip-ansi for cleaning terminal escape codes out of failure messages, and uuid (dynamically imported as ESM) for generating unique output filenames. Dev dependencies show the project dogfoods itself — jest/babel-jest run its own test suite, libxml2-wasm validates generated XML output against schema in tests, and slash normalizes paths in fixtures. CI runs on GitHub Actions across a Node 20/22/23/24 x Jest 30.x matrix plus an ubuntu/macOS matrix, with no database or web framework involved — this is pure CLI/library glue code.

Code Quality Tests live under __tests__/ (buildJsonResults, getOptions, getTestSuitePropertiesPath, testResultProcessor) backed by an extensive set of captured Jest result fixtures under __mocks__/ — failing suites, empty suites, retried tests, multi-project/monorepo runs — giving fairly thorough scenario coverage for a small reporter. Error handling is defensive but soft: getAppOptions catches package.json parse failures and only console.warns rather than throwing. There is no TypeScript and no dedicated lint config in the repo, so option shapes are validated only by the test suite, not by a type system. Naming is consistent throughout, with all env-var-to-option mappings centralized in constants/index.js.

API Design The public surface is a single reporter export configured through jest-junit package.json keys, JEST_JUNIT_* env vars, or reporter options, with a documented precedence order across all three. Getting started requires zero code — just adding the reporter name to Jest’s reporters array — while advanced use (custom naming templates as strings or functions, custom <properties> via drop-in junitProperties.js/junitTestCaseProperties.js files) stays opt-in and additive. Documentation in the README is unusually thorough, walking through each option with rendered XML examples, which keeps the learning curve low despite the fairly large configuration surface.

Used by 11 apps in this directory

TypeScript
96%
Other

Cal.diy

Scheduling

48,697

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
91
Repo Health
86
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
Ruby
64%
AGPL 3.0

Forem

Blogging · Community

22,783

Open source Ruby on Rails platform for building developer communities with articles, discussions, and social profiles—the same software that powers dev.to.

View details
83
Repo Health
79
Technical
67
Dependency
Built with
Ruby 64%
JavaScript 19%
HTML 13%
Updated 6 days ago
Ruby
67%
Other

GitLab

Developer Tools · Devops

24,552

The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.

View details
87
Repo Health
86
Technical
67
Dependency
Built with
Ruby 67%
JavaScript 20%
Updated 4 days ago
TypeScript
48%
AGPL 3.0

Grafana

Analytics · Monitoring

76,962

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 48%
Go 46%
Updated 4 days ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 4 days ago
TypeScript
82%
MIT

LibreChat

AI Assistants · Developer Tools

45,009

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 82%
JavaScript 17%
Updated 4 days ago
Clojure
56%
Other

Metabase

Analytics

49,438

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
64
Dependency
Built with
Clojure 56%
TypeScript 38%
Updated 4 days ago
Python
63%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

46,108

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
67
Dependency
Built with
Python 63%
TypeScript 28%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers