gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

[Feature request] Simpler programmatic usage #793

Open kunagpal opened 7 years ago

kunagpal commented 7 years ago

Related issues: #122, #710

Current workaround: https://github.com/kunagpal/express-boilerplate/blob/develop/scripts/misc/test.js

With programmatic usage enabled, this would take the form:

var istanbul = require('istanbul');

istanbul.cover('/path/to/test/script.js or mocha stub', {
  print: 'both',
  colors: true
  ...
});