Skip to content

Commit

Permalink
Support disabling reporter in programmatic API
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Nov 14, 2021
1 parent 01e9e98 commit 3876b0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ hallmark --report json
hallmark --report [ json --pretty ]
```

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

## Install

With [npm](https://npmjs.org) do:
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ function hallmark (options, callback) {
let reporter
let reporterOptions

if (options.report) {
if (options.report === false) {
reporter = function noop () {}
} else if (options.report) {
// Only take one --report option
reporter = [].concat(options.report)[0]

Expand Down

0 comments on commit 3876b0f

Please sign in to comment.