test(core): pin three composition-length rules that no test covered - #5000
Conversation
terencecho
left a comment
There was a problem hiding this comment.
Approving c4b7418e. The four new tests pin the rules my #4990 review found unpinned, and each goes red when its rule is removed. The diff is one test file (+55, 0 deletions); no production code changes.
What I verified
compositionLength.test.tspasses 20/20, 3 runs in a row, withNODE_ENV=test.- I mutated
compositionLength.tssix ways, and each mutant failed only the intended test:- Dropping the direct-child filter in
resolveAuthoredCompositionFloorSecondsfails "counts only the root's own sub-compositions". The nested 50 s clip turns the 3 s floor into 51 s. - Changing
<=to<in the media window fails "skips a media clip of one frame or less". The test feeds exactlyMIN_VALID_TIMELINE_DURATION_SECONDS, so the boundary itself is pinned. Removing the skip altogether fails the same test. - Removing the
[data-lottie-src]check fails the declared-Lottie test, and removing theunregisteredLottieflag fails the loaded-library test. - Forcing the Lottie branch to always push
nullfails two existing tests as well, so those pending-clip cases were already covered.
- Dropping the direct-child filter in
- The tests call the exported functions on a parsed document with the real start resolver, not mocks, so they pin the rule and not an implementation detail.
oxfmt --checkandoxlintare clean on the file.
CI
- The
Buildjob was cancelled at its 10-minute cap:bun run buildtook 7m46s, soverify:packed-manifestswas cut off.Studio: edit accuracy gatethen failed because its shards need Build's CLI artifact and never ran ("Edit accuracy fell against the base branch" is that missing data, not a measured drop; nothing in a core test file can change it).Studio and player captureswas also cancelled, on a superseded duplicate run. - Every other check at this head finished green (57 pass, 10 skipped). Build and the edit-accuracy gate need a rerun before this can merge; I did not rerun them.
Non-blocking: the one-frame test pins the boundary at exactly one frame; a threshold raised slightly above one frame would not be caught. Nothing in the module's contract calls for more.
I read the diff, ran the tests and mutants locally, and did not run the browser or Studio. This approval is on code merit and is not authorization to merge or deploy beyond what the gate already does.
— Review by tai (pr-review)
Edit accuracy: accurate 1556 (base branch 1556), smooth 1435 of thoseThe gate passes. Quarantined, measured but not gated (0) |
What
Tests only. Three rules moved unchanged into
@hyperframes/core/runtime/composition-lengthby #4990 had no test that fails when the rule is removed. This adds one for each:data-lottie-src, or a loaded Lottie library, keeps the derived length pending until it registers.Why
The review of #4990 found that removing any of these three rules left every test green. They were moved without change, so this is an older coverage gap, closed now so a later edit to the module cannot drop one silently.
Related work
Refs #4990.
How
Four cases in
packages/core/src/runtime/compositionLength.test.ts, driving the exported functions directly on a linkedom document.Test plan
compositionLength.test.ts20 passed, 3 runs in a row.[data-lottie-src]check, the loaded-library flag), and only that test.oxfmt --checkclean; coretsc --noEmitexit 0.Size: test-only on purpose, the follow-up promised in #4990's review.