Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

mocha-junit

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-junit

Write junit compatible results file

latest
Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
12
500%
Maintainers
8
Weekly downloads
 
Created
Source

This Module can be loaded via mocha --require. It is only activated if process.env.REPORT_FILE is set. If activated, it:

  • writes a junit-compatible xml-report to the file denoted in process.env.REPORT_FILE
  • captures all stdout/stderr from tests and redirects them to this report
  • sets mocha exit code to zero, if test results are written successful

Hook Behaviour

If a Mocha hook fails, the hook is counted as one failure, and mocha behaves as follows:

  • before all: all tests in the block are ignored
  • after all: all tests have their normal results
  • before each: the remaining tests are ignored
  • after each: the remaining tests are ignored

To keep the number of tests constant, this behavior is changed:

  • before all: first test in block fails with the hook failure, remaining tests are pending
  • after all: last test in block fails with the hook failure
  • before each: next test fails with the hook failure, remaining tests are pending
  • after each: last test fails with the hook failure, remaining tests are pending

FAQs

Package last updated on 25 Sep 2018

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