Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tap-reader #35

Merged
merged 7 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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