test: guard what the handlers claim and what the entry costs - #57
Merged
Merged
Conversation
Two checks that keep a gap from reopening rather than testing anything new. The first reads the mime lists out of the handlers and asserts each one is opened by a test. A claim nobody exercises is how the audio handler came to offer eleven types with a fixture that no spec touched. Types that cannot be covered from the playground are listed with a reason, and the list is guarded both ways: an excuse for a type no longer claimed fails, and so does an excuse for a type a test does open. It found three things on its first run. video/webm and audio/aac were claimed and untested, so both have fixtures now. And image/apng was excused on the grounds that the server has no mapping for the extension, which is true and is a different concern: the playground proves the handler renders one, and whether an upload ever arrives as that mime belongs to the server suite. The second extends the size check to dependencies. It walked this library's own chunks and stopped at the package boundary, so konva or the score renderer imported at the top level would have passed it. Both have come close: the editor is behind an async component and the renderer behind an import inside its component, and neither arrangement was checked by anything. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=======================================
Coverage 88.62% 88.62%
=======================================
Files 39 39
Lines 2743 2743
Branches 561 561
=======================================
Hits 2431 2431
Misses 305 305
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two checks that stop a gap reopening, rather than tests of anything new.
What the handlers claim
Reads the mime lists straight out of the models and asserts each one is opened by a test. A claim nobody exercises is how the audio handler ended up offering eleven types while a single fixture sat in the playground that no spec ever touched.
Types that cannot be covered from the playground are listed with a reason, and the list is guarded in both directions: an excuse for a type no longer claimed fails, and so does an excuse for a type some test does open. So the excuses have to be argued for rather than inherited.
It found three things on its first run, which is the best argument for it:
video/webmwas claimed and untested. There was a webm fixture, but it was audio.audio/aacwas claimed and untested. The m4a fixture isaudio/mp4, a different type.image/apngwas excused because the server has no.apngmapping. That is true and it is a different concern: the playground proves the handler renders one, and whether an upload ever arrives as that mime belongs to the server suite. Excuse removed.Both gaps now have fixtures, and a small video spec to open them.
What the entry costs
check-bundle-size.mjsalready walked the static graph with a gzip budget and a list of chunks that must stay lazy. It stopped at the package boundary: it only followed relative specifiers, soimport 'konva'at the top level would have sailed through.That is the mistake most likely to be made here, and it has come close twice. The editor sits behind
defineAsyncComponentand the score renderer behind an import inside its own component, and until now nothing checked either arrangement. Two megabytes on every Files page is a bad way to find out.I checked it fails rather than assuming: importing
opensheetmusicdisplayat the top oflib/index.tsmakes it exit 1 and name the package.One thing worth saying: I wrote a second script for this before noticing the existing one did most of it. Deleted, and the check went where it belonged.
378 unit, 86 e2e.
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.