You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sarif-junit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sarif-junit

Convert your SARIF output into a JUnit XML file

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
2.4K
-28.32%
Maintainers
1
Weekly downloads
 
Created
Source



Sarif-JUnit

This project aims to convert a SARIF output file from a linter to a JUnit XML output file. It could be used inside GitLab to show which tests are failing in the CI/CD pipeline. It was created to be used in the mega_linter job hosted on r2devops.io.

Installation

# npm
npm install -g sarif-junit@latest

# yarn
yarn global add sarif-junit@latest

You can update latest tag by a specific version tag

Usage

You can use this tool in two ways:

1. Using the CLI

sarif-junit --input <input-file> --output <output-file>
[--test-suite <test-suite>] 

👉 You can also use the short version of the arguments -i and -o.

2. Importing the module in your code

Here is an example of how to read a SARIF file and convert it to a CodeClimate file:

const saver = require('sarif-junit/lib/saver');
const fs = require('fs');

//Read the input file
let input_sarif_file = null
try {
  input_sarif_file = fs.readFileSync("result.sarif", 'utf8');
} catch (e) {
  console.log(e.message);
}
saver(input_sarif_file, "result.xml", "testSuite");

Contributing

Are you missing something or want to contribute? Feel free to open an issue or create a pull request

License

MIT

Author

GridexX, a french DevOps working for R2DevOps; with help of nvuillam

Keywords

junit

FAQs

Package last updated on 02 Nov 2022

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