macaca-coverage

1.1.2 • Public • Published

macaca-coverage

NPM version build status Test coverage node version npm download

Macaca coverage tool

Use as CLI

Install Macaca command-line tool form npm

$ npm i macaca-coverage -g

Sample:

# step1, checkout a new branch
$ git checkout -b new/branch
# step2, modify code and commit ...
# step3, run testcase
$ npm i
$ npm run test
# step4, gen diff reporter
$ ./bin/macaca-coverage.js diff --target-branch master --coverage-json-file ./coverage/coverage-final.json --output ./test/temp

Use as Node.js module

Install it form npm

$ npm i macaca-coverage --save-dev
import Coverage from 'macaca-coverage';

const {
  collector,
  Reporter,
} = Coverage({
  runtime: 'web' // web, iOS, Android
});

const reporter = new Reporter();

collector.add(__coverage__);

reporter.addAll([
  'html',
  'lcov'
]);

reporter.write(collector, true, () => {
});

Contributors


xudafeng


snapre


Jodeee

This project follows the git-contributor spec, auto updated at Tue Apr 25 2023 15:58:15 GMT+0800.

License

The MIT License (MIT)

Package Sidebar

Install

npm i macaca-coverage

Weekly Downloads

468

Version

1.1.2

License

MIT

Unpacked Size

24.5 kB

Total Files

16

Last publish

Collaborators

  • xudafeng
  • snapre