Skip to content

test(core): write bodies for skipped and todo tests#2466

Merged
joshuaellis merged 12 commits into
nextfrom
worktree-restore-tests
May 22, 2026
Merged

test(core): write bodies for skipped and todo tests#2466
joshuaellis merged 12 commits into
nextfrom
worktree-restore-tests

Conversation

@joshuaellis
Copy link
Copy Markdown
Member

@joshuaellis joshuaellis commented May 22, 2026

Walks through every it.skip and it.todo in core and replaces the placeholders with real test bodies. 19 of 20 todos and both skips are now passing tests.

Notable

Two it.skips recovered by fixing the test, not the code: should bounce had damping: 1 despite being inside describe('when damping is less than 1.0'); the numeric/string parity test was demanding bitwise equality from paths that drift by one ULP.

Locked in immediate: true lifecycle semantics: onStart and onRest fire on the next frame with finished: true. spring.set() is the lifecycle-free path; the docs are updated to reflect this.

Deferred

One todo (to-prop change → avoids calling the "onRest" prop) is left as .todo. The current code fires the prior onRest on retarget, which contradicts the documented contract — fix in #2467.

The test sat inside 'when damping is less than 1.0' but passed damping: 1
(critical damping), so countBounces was always 0. Set damping: 0.5 to
match the describe block's premise.
The numeric and string-numeric animation paths agree to ~15 significant
digits but diverge by one ULP because the string path routes values
through the interpolator. Compare frames with a tolerance instead of
bitwise equality.
Implements the "still resolves the start promise" todo: when start({
immediate: true }) is used, the returned promise resolves with finished:
true and the final value.
Implements the "controls the start value" todo: passing a "from" prop on
start sets the spring to that value before the first frame, and the
first emitted frame moves toward "to".
Implements two "to" prop change todos: when start() is called with a new
"to" mid-animation, the old promise resolves with finished:false, and an
onStart prop captured by an earlier start() call is not invoked again
when the retarget call passes no new onStart.

The third todo (avoids calling the onRest prop) remains because the
current implementation does call the previous onRest on retarget.
Implements the two "reset prop" todos: when start({ reset: true }) is
called mid-animation, the previous start promise resolves with finished:
false, and the previous onRest is invoked with finished: false.
Implements the "preserves its onRest prop between animations" todo: when
a spring tracks a fluid target, an "onRest" handler set on the original
start call fires for each subsequent settle as the target re-animates.
Implements the five Interpolation todos: covers SpringValue, nested
Interpolation, and a custom non-animated FluidValue as sources, asserts
that simultaneous input updates trigger a single recompute per frame,
and that resetting an input updates the interpolation synchronously
before the next frame.
Implements the five useTrail todos: a props function is not re-invoked
when the hook re-renders with no deps change, and toggling the "reverse"
prop swaps "to"/"from" on the new head and flips the parent-spring
chaining direction for the followers.
Implements the remaining two "immediate" prop todos by locking in the
current behaviour: an immediate animation still fires onStart and onRest
on the next frame with finished: true. This matches the convention used
by Framer Motion, GSAP, the Web Animations API, and React Native
Animated, where a zero-duration animation completes through the normal
lifecycle. spring.set() remains the lifecycle-free path.
"Prevents the animation if true" implied no lifecycle events. The
immediate animation still fires onStart and onRest on its single frame;
SpringValue.set() is the lifecycle-free path.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-spring Ready Ready Preview May 22, 2026 6:51am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: dd95e57

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

The `private value` shorthand declared a class field that was never
read — the constructor captures the local parameter via closure. TS6138
fails strict CI matrix builds.
@joshuaellis joshuaellis changed the title test(core): write bodies for skipped and todo SpringValue tests test(core): write bodies for skipped and todo tests May 22, 2026
@joshuaellis joshuaellis merged commit 027a133 into next May 22, 2026
18 checks passed
@joshuaellis joshuaellis deleted the worktree-restore-tests branch May 22, 2026 06:53
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