
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
jest-junit
Advanced tools
A Jest reporter that creates compatible junit xml files
yarn add --dev jest-junit
In your jest config add the following entry:
{
"testResultsProcessor": "./node_modules/jest-junit"
}
Then simply run:
jest
jest-junit offers five configurations based on environment variables. All are string values
| Variable Name | Default |
|---|---|
JEST_SUITE_NAME | "jest tests" |
JEST_JUNIT_OUTPUT | "./junit.xml" |
JEST_JUNIT_CLASSNAME | "{classname} {title}" |
JEST_JUNIT_TITLE | "{classname} {title}" |
JEST_USE_PATH_FOR_SUITE_NAME | "false" |
Example:
JEST_SUITE_NAME="Jest JUnit Unit Tests" JEST_JUNIT_OUTPUT="./artifacts/junit.xml" jest
You can also define a jest-junit key in your package.json. All are string values.
{
...
"jest-junit": {
"suiteName": "jest tests",
"output": "./junit.xml",
"classNameTemplate": "{classname}-{title}",
"titleTemplate": "{classname}-{title}",
"usePathForSuiteName": "true"
}
}
Example output:
<testsuites name="Jest JUnit Unit Tests">
<testsuite name="My first suite" tests="1" errors="0" failures="0" skipped="0" timestamp="2016-11-19T01:37:20" time="0.105">
<testcase classname="My test case" name="My test case" time="6">
</testcase>
</testsuite>
</testsuites>
Changing the title and classname
JEST_JUNIT_CLASSNAME="{classname}" JEST_JUNIT_TITLE="{title}" jest
<testsuites name="jest tests">
<testsuite name="foo" tests="1" errors="0" failures="0" skipped="0" timestamp="2017-02-19T22:36:15" time="0.232">
<testcase classname="foo" name="bar" time="0.003">
</testcase>
</testsuite>
</testsuites>
Similar to jest-junit, mocha-junit-reporter is designed for Mocha tests. It generates JUnit XML reports for Mocha test suites. While jest-junit is tailored for Jest, mocha-junit-reporter offers similar functionality for projects using Mocha as their testing framework.
karma-junit-reporter is a plugin for the Karma test runner that outputs test results in JUnit XML format. It serves a similar purpose for Karma-based projects, providing integration with CI/CD tools that require JUnit XML reports. Compared to jest-junit, it's specific to the Karma ecosystem.
jasmine-reporters is a package that provides JUnit XML reporting for Jasmine, another popular testing framework. It includes a JUnit reporter among other reporter types. This package is analogous to jest-junit for projects that use Jasmine, enabling them to generate JUnit-compatible reports.
FAQs
A jest reporter that generates junit xml files
The npm package jest-junit receives a total of 5,701,078 weekly downloads. As such, jest-junit popularity was classified as popular.
We found that jest-junit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.