
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
jest-json-reporter2
Advanced tools
A reporter for jest that saves test results to JSON file.
yarn add --dev jest-json-reporter2
Add the following config to your jest.config.js
or the Jest configuration in the package.json
.
// default options
const jsonreporter2Options = {
outputDir = './coverage', // what directory to output to
outputFile = 'test-results.json', // what to call the file
fullOutput = false // to output the full results from Jest or consolidated results
}
module.exports = {
rootDir: process.cwd(),
// ...other config
// without options
reporters: ['jest-json-reporter2']
// with options
reporters: [['jest-json-reporter2', jsonreporter2Options]]
};
We give you the option to output the full results returned by Jest or a consolidated view. See the options above to see how to flip between outputs.
{
"suites": {
"failed": 0,
"skipped": 1,
"success": 2
},
"tests": {
"failed": 0,
"skipped": 1,
"success": 2
}
}
{
"numFailedTestSuites": 0,
"numFailedTests": 0,
"numPassedTestSuites": 1,
"numPassedTests": 1,
"numPendingTestSuites": 0,
"numPendingTests": 0,
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 1,
"numTotalTests": 1,
"snapshot": {
"added": 0,
"didUpdate": false,
"failure": false,
"filesAdded": 0,
"filesRemoved": 0,
"filesUnmatched": 0,
"filesUpdated": 0,
"matched": 0,
"total": 0,
"unchecked": 0,
"uncheckedKeys": [],
"unmatched": 0,
"updated": 0
},
"startTime": 1520435906852,
"success": false,
"testResults": [
{
"console": null,
"failureMessage": null,
"numFailingTests": 0,
"numPassingTests": 1,
"numPendingTests": 0,
"perfStats": {
"end": 1520435908707,
"start": 1520435907548
},
"snapshot": {
"added": 0,
"fileDeleted": false,
"matched": 0,
"unchecked": 0,
"unmatched": 0,
"updated": 0,
"uncheckedKeys": []
},
"testFilePath": "/Users/who/dir/__tests__/index.js",
"testResults": [
{
"ancestorTitles": [],
"duration": 8,
"failureMessages": [],
"fullName": "it should call the post route with the proper data",
"location": null,
"numPassingAsserts": 0,
"status": "passed",
"title": "it should call the post route with the proper data"
}
],
"sourceMaps": {},
"skipped": false,
"leaks": false
}
],
"wasInterrupted": false
}
FAQs
a reporter for jest that saves test results to json file
The npm package jest-json-reporter2 receives a total of 2,825 weekly downloads. As such, jest-json-reporter2 popularity was classified as popular.
We found that jest-json-reporter2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.