Skip to content

Internalize TAP reporter and ditch “tap-parser”.#11

Merged
theengineear merged 1 commit intomainfrom
internalize-tap-reporter
Apr 21, 2026
Merged

Internalize TAP reporter and ditch “tap-parser”.#11
theengineear merged 1 commit intomainfrom
internalize-tap-reporter

Conversation

@theengineear
Copy link
Copy Markdown
Collaborator

This is a minimal CLI for a minimal testing library. We can be very targeted about the problems we seek to solve. As such, a very small subset of TAP-parsing functionality is needed — more than would warrant pulling in tap-parser at this point. We add x-test-cli-tap.js to handle all our TAP-y needs.

To keep things interoperable with the previous pass-through output, we allow developers to pass --reporter=tap (mimicking Node’s naming). Otherwise, developers now get a stylized output in their terminal. Care was taken to handle cases where developers have indicated (or implied) that they do not want stylized output (e.g., while piping to something like grep).

Finally, the TAP output text content is not changed, just stylized. I.e., stripping back out the stylization would leave you with the original text from x-test.

Closes #4 and closes #7.

Comment thread package.json Outdated
"scripts": {
"lint": "eslint --max-warnings=0 .",
"lint-fix": "eslint --fix .",
"test": "node --test 'test/**/*.test.js'",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s actually really satisfying to see all the parallels between the default node test runner and our own, browser-based test runner. This project has really helped me understand the exact Venn diagram we are working with :^)

Comment thread package.json
"lint": "eslint --max-warnings=0 .",
"lint-fix": "eslint --fix .",
"test": "node --test 'test/**/*.test.js'",
"demo": "node demo/index.js",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a demo suite to make it easier to feel the result locally in the CLI.

@theengineear theengineear force-pushed the internalize-tap-reporter branch 3 times, most recently from 32865ef to eb1002f Compare April 21, 2026 23:12
This is a minimal CLI for a minimal testing library. We can be very
targeted about the problems we seek to solve. As such, a _very_ small
subset of TAP-parsing functionality is needed — more than would warrant
pulling in `tap-parser` at this point. We add `x-test-cli-tap.js` to
handle all our TAP-y needs.

To keep things interoperable with the previous pass-through output, we
allow developers to pass `--reporter=tap` (mimicking Node’s naming).
Otherwise, developers now get a stylized output in their terminal. Care
was taken to handle cases where developers have indicated (or implied)
that they do not _want_ stylized output (e.g., while piping to something
like `grep`).

Finally, the TAP output _text_ content is not changed, just stylized.
I.e., stripping back out the stylization would leave you with the
original text from x-test.

Closes #4 and closes #7.
@theengineear theengineear force-pushed the internalize-tap-reporter branch from eb1002f to e66f4e7 Compare April 21, 2026 23:15
@theengineear theengineear merged commit c8fd9eb into main Apr 21, 2026
1 check passed
@theengineear theengineear deleted the internalize-tap-reporter branch April 21, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add “--reporter” option to CLI which can “auto”-colorize TAP output. Internalize TAP parser to remove “tap-parser” dependency.

1 participant