Repository navigation
test(gui): stub Web Animations API for jsdom - #367
Merged
Merged
Conversation
jsdom implements no Web Animations API. Svelte calls element.animate() when a transition runs, and from 5.57 it does so from a deferred microtask, so the TypeError escapes the test that triggered it and fails the whole run even though every assertion passes. Provide an inert Animation in the vitest setup: playState "finished" stops Svelte's rAF loop immediately, and onfinish is left unfired so transitions stay no-ops rather than half-applying. Verified against the lockfile from #363 — red on svelte 5.57.0 without the stub, green with it, and green either way on the 5.56.9 currently on main. Unblocks #361 and #363.
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.
jsdom implements no Web Animations API. Svelte calls
element.animate()when a transition runs, and from 5.57 it does so from a deferred microtask, so theTypeErrorescapes the test that triggered it and fails the whole run even though every assertion passes.This is what currently blocks #361 and #363 — both bump svelte 5.56.9 → 5.57.0, and both fail
GUI / Test & Buildwith:Note this is not a jsdom bump — jsdom is 30.0.1 on main and on both PRs. Both svelte versions call
element.animate; 5.57.0 changed when, moving it into a deferred microtask where the throw is no longer contained.Fix
An inert
Animationin the vitest setup.playState: "finished"stops Svelte's rAF loop immediately, andonfinishis left unfired so transitions stay no-ops rather than half-applying.Verification
Run against #363's lockfile, varying only the svelte version:
TypeError, 339/339 assertions still passSo the stub fixes the failure and is inert on the version main is on today.
tsc --noEmitclean;svelte-check382 files, 0 errors.