@bizantine/report-generator

1.0.1 • Public • Published

@Bizantine/report-generator

Introduction

The library generates a JavaScript code coverage report for modified files by comparing them with git-diff information, and presents the report in the istanbul.js (also known as nyc) HTML format.

Usage

API - genReport

const { genReport } = require('@bizantine/report-generator')

genReport({
          coverageOb: coverage, // such as { 'file.js': b: {0: [1, 0]}, branchMap: {0: {loc: {start: {line: 1, column: 4 ...}}}}}
          targetPath: somewhere, // path generate file to, relative or absolute path
          gitDiff: diff,  // such as '$git diff hash1 hash2' log messages 
          otherCoverageOb: oldCoverRawData// other coverage data expected be merged
        }).then((coverRawData)=>{
            //  store this coverRawData for merge other data in the future, this coverRawData is already mapped by inputSouceMap
        })

genReport function generate code coverage report in HTML format at targetPath

  • coverageOb : an object build by @bizantine/babel-plugin
  • targetPath : the report file path
  • gitDiff : git diff log messages
  • otherCoverageOb : other coverage data expected be merged to coverageOb

Sample Code

Readme

Keywords

none

Package Sidebar

Install

npm i @bizantine/report-generator

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

36.5 kB

Total Files

6

Last publish

Collaborators

  • xinkai.wang