Install mochawesome as a development dependency, then run Mocha with --reporter mochawesome. By default, the reporter creates a readable HTML report and raw JSON data in mochawesome-report/.
Install Mochawesome and generate your first report
-
From your project directory, install Mochawesome:
npm install --save-dev mochawesome -
Run Mocha with the reporter selected:
npx mocha testfile.js --reporter mochawesomeReplace
testfile.jswith your test file or the path/glob your project uses. If your project runs tests through an npm script, add the reporter and its options to that script instead. The package documentation also shows callingmochadirectly; use whichever executable resolution your project already uses.As an Amazon Associate I earn from qualifying purchases.
-
Open
mochawesome-report/mochawesome.htmlin a browser to read the report. The companionmochawesome.jsoncontains the raw report data.The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Mochawesome is a custom reporter for Mocha. The package documentation accessed on October 3, 2026 lists Node.js 18 or later and Mocha 8–12 as requirements. These version ranges can change, so check the current Mochawesome package page if installation or compatibility fails.
#1 Best Overall
Choose output formats and report names
Mochawesome’s documented defaults enable both HTML and JSON output. The HTML is intended for reading; JSON is structured data suitable for another reporting step or tool.
| Option | Documented default | What it controls |
|---|---|---|
reportFilename |
mochawesome |
Base filename for report output. |
html |
true |
Whether to produce HTML. |
json |
true |
Whether to produce JSON. |
quiet |
false |
Whether to quiet the reporter’s output. |
consoleReporter |
spec |
Console reporter to use; set to none to suppress console report output. |
Pass reporter options as comma-separated values after --reporter-options. For example, this changes the report directory and base filename:
npx mocha test.js --reporter mochawesome --reporter-options reportDir=customReportDir,reportFilename=customReportFilename
Options can also be provided as a reporterOptions object in programmatic use. The package documentation supports environment variables prefixed with MOCHAWESOME_; options passed directly to the reporter take precedence over environment variables.
Use Mochawesome with Mocha parallel mode
Parallel mode needs an additional registration step. Use the documented mochawesome/register hook:
npx mocha tests --reporter mochawesome --require mochawesome/register
Mocha creates a separate instance for each test file in parallel mode. Its guidance recommends putting root hooks that must apply across files in a required file. Do not rely on a fixed order of file execution in parallel runs; workers can execute files independently.
Generate HTML later from JSON with marge
If you want to keep test execution separate from report rendering, the mochawesome-report-generator package, commonly called marge, accepts Mochawesome JSON and produces HTML/CSS output. Its documented controls include the report filename and directory, title, asset handling, chart display, and whether to save HTML or JSON. This is useful when JSON is already available or you want a separate generation step. See the report-generator package documentation for its current options.
Mochawesome versus Mocha’s built-in JSON reporter
These reporters serve different output needs. Mochawesome generates an HTML report alongside JSON by default; Mocha’s built-in JSON reporter outputs a JSON object after tests finish and can write it to a specified filename. The built-in JSON reporter alone does not create the Mochawesome HTML report. See Mocha’s reporter documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Troubleshoot common report problems
-
No report appears: Confirm the command selected
--reporter mochawesome, ran from the intended project, and completed with a test file or matching test path. Check the configuredreportDirrather than assuming the default output location.Best Value
-
Mocha cannot find the reporter: Install
mochawesomein the project withnpm install --save-dev mochawesomeand invoke Mocha through the project’s local executable, such asnpx mocha. Check Node.js and Mocha against the compatibility requirements on the current package page. -
HTML or JSON is missing: Check whether the corresponding
htmlorjsonoption was disabled. Both are enabled by default according to the package documentation. -
The output has an unexpected name or location: Review
reportFilename,reportDir, environment variables beginning withMOCHAWESOME_, and any command-line reporter options. Directly passed reporter options take precedence over environment variables.Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Parallel execution behaves differently: Include
--require mochawesome/registerand avoid assumptions about file order or shared per-file Mocha instances. Put cross-file root hooks in a required file as Mocha recommends.
Or skip the browser setup
If your next step is capturing a web page for visual review, ScreenshotNeo is a website screenshot API and MCP server for developers. Its API returns a screenshot or PDF from one GET request. For example, use cURL:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for setup and options. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card required.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




