Skip to content

fix: name the way out in four more messages - #10

Merged
sorge-it merged 1 commit into
mainfrom
fix/four-more-messages
Nov 21, 2026
Merged

sorge-it merged 1 commit into
mainfrom
fix/four-more-messages

Conversation

@sorge-it

Copy link
Copy Markdown
Owner

What

Four more messages name the way out:

Case Now adds
ClosedWithErrors "Fix the handler, or let each request finish before close(). To fail the test at the error instead of at close(), pass onError: static fn (Throwable $e): never => throw $e; a test that expects the error passes an onError that records it."
a chunk of a streamed body that is not a string "A streamed body yields strings; for JSON, pass json_encode($data) as the body."
a handler that returns null "Return a Response from every path of the handler."
a host that is not loopback "Run the browser on the same host or in the same container as the test."

Why

The second review of the release found that the message of ClosedWithErrors from #9 said "only a
test that expects the error passes onError", against the README's rule to pass an onError that
throws in each test. A coding agent reads the message first and would drop that onError. The
third review found that "Fix the handler" is wrong where close() cut a request. The other three
messages said what went wrong, but not what to do.

Tests

The tests that quote the four messages follow the new texts. composer test in Docker on Debian
(PHP 8.4) and Alpine (PHP 8.5, locked and newest), on arm64 and amd64, coverage and mutation of
src/Server.php and src/ClosedWithErrors.php: running; this PR is merged only after them.

The second review found that the message of ClosedWithErrors told a
test without an expected error to drop onError, against the README. It
now names the onError that fails the test at the error; three other
messages name their fix too.
@sorge-it
sorge-it marked this pull request as ready for review November 21, 2026 19:09
@sorge-it
sorge-it merged commit 955fe5f into main Nov 21, 2026
13 of 14 checks passed
@sorge-it
sorge-it deleted the fix/four-more-messages branch November 21, 2026 19:09
@sorge-it sorge-it mentioned this pull request Nov 21, 2026
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.

1 participant