istanbul-lib-report
Advanced tools
Comparing version 3.0.0-alpha.0 to 3.0.0-alpha.1
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.0.0-alpha.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-report@3.0.0-alpha.0...istanbul-lib-report@3.0.0-alpha.1) (2019-10-06) | ||
**Note:** Version bump only for package istanbul-lib-report | ||
# [3.0.0-alpha.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-report@2.0.8...istanbul-lib-report@3.0.0-alpha.0) (2019-06-19) | ||
@@ -8,0 +16,0 @@ |
@@ -7,4 +7,4 @@ 'use strict'; | ||
class ReportBase { | ||
constructor(summarizer) { | ||
this[_summarizer] = summarizer; | ||
constructor(opts = {}) { | ||
this[_summarizer] = opts.summarizer; | ||
} | ||
@@ -11,0 +11,0 @@ |
@@ -83,3 +83,3 @@ /* | ||
if (this.hasOwnProperty(cacheProp)) { | ||
if (Object.prototype.hasOwnProperty.call(this, cacheProp)) { | ||
return this[cacheProp]; | ||
@@ -86,0 +86,0 @@ } |
{ | ||
"name": "istanbul-lib-report", | ||
"version": "3.0.0-alpha.0", | ||
"version": "3.0.0-alpha.1", | ||
"description": "Base reporting library for istanbul", | ||
@@ -12,14 +12,14 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", | ||
"scripts": { | ||
"test": "nyc --nycrc-path=../../monorepo-per-package-nycrc.json mocha" | ||
"test": "nyc --nycrc-path=../../monorepo-per-package-full.js mocha" | ||
}, | ||
"dependencies": { | ||
"istanbul-lib-coverage": "^3.0.0-alpha.0", | ||
"istanbul-lib-coverage": "^3.0.0-alpha.1", | ||
"make-dir": "^3.0.0", | ||
"supports-color": "^7.0.0" | ||
"supports-color": "^7.1.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^6.1.4", | ||
"mocha": "^6.2.1", | ||
"nyc": "^14.1.1", | ||
"rimraf": "^2.6.3" | ||
"rimraf": "^3.0.0" | ||
}, | ||
@@ -33,3 +33,4 @@ "license": "BSD-3-Clause", | ||
"type": "git", | ||
"url": "git@github.com:istanbuljs/istanbuljs.git" | ||
"url": "git+ssh://git@github.com/istanbuljs/istanbuljs.git", | ||
"directory": "packages/istanbul-lib-report" | ||
}, | ||
@@ -45,3 +46,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "2e885073a9398806c9b8763dd39418398182ca34" | ||
"gitHead": "4d5e777a9bc4847d178ad31f379307124cdd1e4f" | ||
} |
@@ -6,2 +6,39 @@ # istanbul-lib-report | ||
Core reporting utilities for istanbul. Docs to follow. | ||
Core reporting utilities for istanbul. | ||
## Example usage | ||
```js | ||
const libReport = require('istanbul-lib-report'); | ||
const reports = require('istanbul-reports'); | ||
// coverageMap, for instance, obtained from istanbul-lib-coverage | ||
const coverageMap; | ||
const configWatermarks = { | ||
statements: [50, 80], | ||
functions: [50, 80], | ||
branches: [50, 80], | ||
lines: [50, 80] | ||
}; | ||
// create a context for report generation | ||
const context = libReport.createContext({ | ||
dir: 'report/output/dir', | ||
// The summarizer to default to (may be overridden by some reports) | ||
// values can be nested/flat/pkg. Defaults to 'pkg' | ||
defaultSummarizer: 'nested', | ||
watermarks: configWatermarks, | ||
coverageMap, | ||
}) | ||
// create an instance of the relevant report class, passing the | ||
// report name e.g. json/html/html-spa/text | ||
const report = reports.create('json', { | ||
skipEmpty: configSkipEmpty, | ||
skipFull: configSkipFull | ||
}) | ||
// call execute to synchronously create and write the report to disk | ||
report.execute(context) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37043
44