Skip to content
Frédéric Jouault edited this page Dec 15, 2022 · 1 revision

Frameworks

AnimUML uses the Mocha test framework, along with Istanbul.js for coverage.

How to Run Tests

package.json contains a few scripts to run tests:

  • test is the main script. It can be launched with commands npm test, or npm run test. It is intended to be run from the command line. It uses the nyc command to invoke Istanbul.js, with command line arguments instructing it to launch Mocha. It reports coverage in both the console, and HTML files.
  • testWithPersistentCoverage is intended to be launched from CI/CD scripts that may run multiple tests in parallel. It must be launched with npm run testWithPersistentCoverage. It also uses the nyc command, but stores coverage reports using the Cobertura file format. Multiple reports can then be merged with script nyc-merge.
  • nyc-merge can be used to merge multiple Cobertura reports generated by script testWithPersistentCoverage. It must be launched with npm run nyc-merge.
  • nyc-report can be used to generate an HTML report from a Cobertura one (as generated by script testWithPersistentCoverage, possibly followed by merge with nyc-merge). It must be launched with npm run nyc-report.

Clone this wiki locally