Skip to content

Commit

Permalink
Use tap-reader (#35)
Browse files Browse the repository at this point in the history
* use tap-reader
* update single-line diff
* update changelog and readme
  • Loading branch information
tbeseda authored Oct 27, 2023
1 parent ccf4b81 commit 3f34cd0
Show file tree
Hide file tree
Showing 15 changed files with 592 additions and 545 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2023-10-27

### Changed

- replace `tap-parser` with `tap-reader` for simpler i/o, shallower dependency graph, and smaller disk footprint
- single-line diffs now output to 2 lines: "Actual" and "Expected" for easier reading

## [1.1.0] - 2023-10-17

Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

## Objectives

- minimal, informative spec-like output for all assertions
- minimal, maintained dependencies
- streaming in and out
- minimal, informative spec-like output for all assertion types
- helpful diffing for failures
- shallow graph of maintained dependencies

![tap-arc output screen shot](./screen-shot.png)

Expand All @@ -41,7 +40,8 @@ Example `npm test` script:
}
```

πŸ’ `tap-arc` will format output from any tap reporter. [`tape`](https://github.com/ljharb/tape) is our favorite and was used for testing.
> [!IMPORTANT]
> πŸ’ `tap-arc` will format output from any tap reporter. [`tape`](https://github.com/ljharb/tape) is our favorite and was used for testing.
### `tap-arc --help`

Expand Down Expand Up @@ -83,10 +83,7 @@ npm run tap-arc.simple # used to create the screen shot above

### Dev Tips

1. `./test/smoke.js` contains the bare minimum usage of `tap-parser` with `process.stdin`.
Helpful for understanding `tap-parser`'s behavior.

2. To see previous exit code, run:
1. To see previous exit code, run:

```sh
echo $?
Expand All @@ -101,12 +98,12 @@ Testing could be improved by unit testing the printer and diff maker.
## FAQ

<details>
<summary>"Expected <code>n</code> assertions, but found <code>< n</code>"</summary>
<summary>"Expected <code>n</code> tests, but found <code>< n</code>"</summary>

_What happened?_
βœ… The TAP parser found zero failing tests
βœ… The final tally from the raw TAP shows `n` of `n` passed
🀨 But the TAP plan called for more assertions than were found, counted, and parsed.
🀨 But the TAP plan called for more tests than were found, counted, and parsed.

πŸ’β€β™€οΈ Currently, when this case is detected, `tap-arc` will exit with a successful status code.
This can be overridden with the `--fail-bad-count` flag.
Expand Down Expand Up @@ -138,4 +135,3 @@ If you'd like to see different behavior from `tap-arc`, please open an issue or

- [tap-spec](https://github.com/scottcorgan/tap-spec) ol' reliable, but a bit stale and vulnerable
- [tap-difflet](https://github.com/namuol/tap-difflet) inspired output and diffing, also vulnerable
- [tap-min](https://github.com/derhuerst/tap-min) helpful approaches to streaming and exit codes, used to report `tap-arc`'s TAP
Loading

0 comments on commit 3f34cd0

Please sign in to comment.