Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627282930313233
  1. istanbul-lib-coverage
  2. ---------------------
  3. [![Greenkeeper badge](https://badges.greenkeeper.io/istanbuljs/istanbul-lib-coverage.svg)](https://greenkeeper.io/)
  4. [![Build Status](https://travis-ci.org/istanbuljs/istanbul-lib-coverage.svg?branch=master)](https://travis-ci.org/istanbuljs/istanbul-lib-coverage)
  5. An API that provides a read-only view of coverage information with the ability
  6. to merge and summarize coverage info.
  7. Supersedes `object-utils` and `collector` from the v0 istanbul API.
  8. See the docs for the full API.
  9. ```js
  10. var libCoverage = require('istanbul-lib-coverage');
  11. var map = libCoverage.createCoverageMap(globalCoverageVar);
  12. var summary = libCoverage.createCoverageSummary();
  13. // merge another coverage map into the one we created
  14. map.merge(otherCoverageMap);
  15. // inspect and summarize all file coverage objects in the map
  16. map.files().forEach(function (f) {
  17. var fc = map.fileCoverageFor(f),
  18. s = fc.toSummary();
  19. summary.merge(s);
  20. });
  21. console.log('Global summary', summary);
  22. ```