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
502stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
54/100Fair
Development Activity40
Maintenance32
Community64
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
60/100Good
Architecture68
Code Quality68
Innovation65
Learning Curve40

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,218

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

View details
95
Repo Health
86
Technical
65
Dependency
Built with
TypeScript96%
Updated yesterday
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,640

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

View details
69
Repo Health
76
Technical
62
Dependency
Built with
JavaScript90%
Updated 1 weeks ago
Ruby
63%
AGPL 3.0

Forem

Community · Blogging

22,775

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
Ruby63%
JavaScript19%
HTML13%
Updated 2 days ago
Ruby
67%
Other

GitLab

Devops · Developer Tools

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
68
Dependency
Built with
Ruby67%
JavaScript20%
Updated today
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,643

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
TypeScript49%
Go45%
Updated today
Python
68%
MIT

Langflow

AI Agents · AI Development

154,349

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
Python68%
TypeScript23%
Updated today
TypeScript
81%
MIT

LibreChat

Developer Tools · AI Assistants

42,871

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
TypeScript81%
JavaScript18%
Updated today
Clojure
55%
Other

Metabase

Analytics

49,109

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
65
Dependency
Built with
Clojure55%
TypeScript40%
Updated today
Python
62%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

44,898

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
Python62%
TypeScript30%
Updated today

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

Search