-
Notifications
You must be signed in to change notification settings - Fork 1
Tests
Frédéric Jouault edited this page Dec 15, 2022
·
1 revision
AnimUML uses the Mocha test framework, along with Istanbul.js for coverage.
package.json contains a few scripts to run tests:
-
testis the main script. It can be launched with commandsnpm test, ornpm run test. It is intended to be run from the command line. It uses thenyccommand to invoke Istanbul.js, with command line arguments instructing it to launch Mocha. It reports coverage in both the console, and HTML files. -
testWithPersistentCoverageis intended to be launched from CI/CD scripts that may run multiple tests in parallel. It must be launched withnpm run testWithPersistentCoverage. It also uses thenyccommand, but stores coverage reports using the Cobertura file format. Multiple reports can then be merged with scriptnyc-merge. -
nyc-mergecan be used to merge multiple Cobertura reports generated by scripttestWithPersistentCoverage. It must be launched withnpm run nyc-merge. -
nyc-reportcan be used to generate an HTML report from a Cobertura one (as generated by scripttestWithPersistentCoverage, possibly followed by merge withnyc-merge). It must be launched withnpm run nyc-report.