
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
mocha-circleci-reporter
Advanced tools
A mocha reporter that supports Circle CI, via a combined jUnit and Spec reporter output.
A Mocha reporter specifically for Circle CI.
Install the reporter as a development dependency:
npm install mocha --save-dev
npm install mocha-circleci-reporter --save-dev
Update your package.json
to use the reporter when running Mocha:
{
"name": "my-package",
"version": "0.0.1",
"scripts": {
"test": "node_modules/.bin/mocha --reporter mocha-circleci-reporter test/*.js"
}
}
mocha-junit-reporter will output
results to test-results.xml
by default. CircleCI needs the results in the $CIRCLE_TEST_REPORTS
directory.
Either update your circle.yml
to copy over the `test-results.xml:
test:
override:
- npm run test
- if [[ -e test-results.xml ]]; then cp test-results.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi
or set the $MOCHA_FILE
:
machine:
environment:
MOCHA_FILE: "$CIRCLE_TEST_REPORTS/test-results.xml"
As of Mocha 2.x, its not possible to use multple reporters out of the box.
This complicates things when dealing with CI systems like Circle CI that
require a format such as jUnit XML
as a lot of the goodness that is written to console when running the default
reporter (Spec
).
To overcome this, we combine the output of both the
builtin Spec
and mocha-junit-report
reporters.
Example spec output:
Example jUnit output:
There is work underway in Mocha 3.x to move to a plugin architecture that would make multiple reporters dead simple, until then I hope this simplifies things.
FAQs
A mocha reporter that supports Circle CI, via a combined jUnit and Spec reporter output.
The npm package mocha-circleci-reporter receives a total of 4,858 weekly downloads. As such, mocha-circleci-reporter popularity was classified as popular.
We found that mocha-circleci-reporter 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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.