Socket
Socket
Sign inDemoInstall

jest-junit

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-junit

A jest reporter that generates junit xml files


Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created

What is jest-junit?

The jest-junit npm package is a Jest reporter that creates compatible JUnit XML reports. It's primarily used in CI/CD pipelines to integrate test results with tools that consume JUnit XML format, such as Jenkins, CircleCI, and others. This allows for better visualization of test outcomes and more efficient debugging when tests fail.

What are jest-junit's main functionalities?

Generating JUnit XML reports

This command runs Jest tests and generates a JUnit XML report. The '--reporters' option specifies that both the default reporter and jest-junit should be used, allowing for output in the console as well as the creation of an XML report.

jest --reporters=default --reporters=jest-junit

Customizing output location and file name

This example demonstrates how to customize the output directory and file name of the JUnit XML report using environment variables. The report will be saved to './artifacts/my_test_results.xml'.

JEST_JUNIT_OUTPUT_DIR='./artifacts' JEST_JUNIT_OUTPUT_NAME='my_test_results.xml' jest --reporters=default --reporters=jest-junit

Configuring through jest.config.js

This code snippet shows how to configure jest-junit through Jest's configuration file, jest.config.js. It specifies custom values for the suite name, output directory, and file name of the report.

module.exports = { reporters: ['default', ['jest-junit', { suiteName: 'My Suite', outputDirectory: './reports', outputName: 'results.xml' }]] };

Other packages similar to jest-junit

FAQs

Package last updated on 21 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc