Skip to content

Commit

Permalink
[readme] Another way to create custom reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
Yves Darmaillac authored and ljharb committed Jul 2, 2021
1 parent 021fa6d commit a68277c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions readme.markdown
Expand Up @@ -447,6 +447,20 @@ $ node object.js test/x.js test/y.js
{"type":"end","test":2}
```

A convenient alternative to achieve the same:
```js
// report.js
var test = require('tape');

test.createStream({ objectMode: true }).on('data', function (row) {
console.log(JSON.stringify(row)) // for example
});
```
and then:
```sh
$ tape -r ./report.js **/*.test.js
```

# install

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

0 comments on commit a68277c

Please sign in to comment.