Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Jul 25, 2023
1 parent cee1619 commit 8d1ac64
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,24 @@ Diff is generated by [`jest-diff`](https://www.npmjs.com/package/jest-diff) (no

Assertion libraries that outputs compatible errors:
* [`node:assert`](https://nodejs.org/api/assert.html#assert)
* [`chai`](https://www.chaijs.com/)
* [`chai`](https://www.chaijs.com/) (**note:** `chai.should()` breaks this in latest Node versions, see [nodejs/node#48918](https://github.com/nodejs/node/issues/48918) and [chaijs/chai#1530](https://github.com/chaijs/chai/issues/1530))

As with other changes, this makes the reporter on par [with Mocha](https://mochajs.org/#diffs).

### Output styling

The output styling aligns more with Mocha's [`spec` reporter](https://mochajs.org/#spec):

* Errors are presented at the end instead of in the list of tests
* ~~Errors are presented at the end instead of in the list of tests~~ _(also done in built in since [nodejs/node#47164](https://github.com/nodejs/node/pull/47164))_
* Less visually intense, eg. no `` in front of names and only failed tests gets colored
* Durations are only reported if considered slow (using same default [as Mocha](https://mochajs.org/#test-duration): 75ms)
* No redundant mentioning of a test suite after the suite has completed – opts for a clean tree from top to bottom instead

### _Planned:_ Outputting the full `cause` chain of an `Error`
### Outputting the full `cause` chain of an `Error`

Originally [a PR of mine to Mocha](https://github.com/mochajs/mocha/pull/4829), my plan was to output the full `cause` chain in this reporter instead, but seems like the full `cause` chain is not available to the reporters, probably due to the reporter and the tests living in different processes. Will investigate further, follow in [issue #2](https://github.com/voxpelli/node-test-pretty-reporter/issues/2).
When used with at least Node `18.17.0` or `20.2.0` this is supported (see [issue #2](https://github.com/voxpelli/node-test-pretty-reporter/issues/2)).

Since those same versions the cause chain is also printed in the built in `spec` reporter, but done through `util.inspect()` there rather than the custom output here.


## Similar modules
Expand Down

0 comments on commit 8d1ac64

Please sign in to comment.