Skip to content

Commit 3876b0f

Browse files
committed
Support disabling reporter in programmatic API
1 parent 01e9e98 commit 3876b0f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ hallmark --report json
272272
hallmark --report [ json --pretty ]
273273
```
274274

275+
In the programmatic API of `hallmark` (which is not documented yet) the reporter can also be disabled by passing `{ report: false }` as the options.
276+
275277
## Install
276278

277279
With [npm](https://npmjs.org) do:

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function hallmark (options, callback) {
3131
let reporter
3232
let reporterOptions
3333

34-
if (options.report) {
34+
if (options.report === false) {
35+
reporter = function noop () {}
36+
} else if (options.report) {
3537
// Only take one --report option
3638
reporter = [].concat(options.report)[0]
3739

0 commit comments

Comments
 (0)