Skip to content

Commit 1a6d466

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
trigger animations at time 0 in fantom (#51776)
Summary: Pull Request resolved: #51776 changelog: [internal] testing animation must be predictable. When animation takes 1 second and test calls `unstable_advanceAnimationsByTime(1000)`, the expectation is that the animation would have completed. Previously it was necessary to wait for at least 38ms over the time it took to complete animation. This diff reduces the delta to 22ms. Reviewed By: andrewdacenko Differential Revision: D75813087 fbshipit-source-id: 1a27e5c227a0f3f1183ebdf41dc8c18149d68be0
1 parent eb6e1b8 commit 1a6d466

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react-native/Libraries/Animated/__tests__/Animated-itest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ test('moving box by 100 points', () => {
6161
}).start();
6262
});
6363

64-
// TODO: this fails with any value below 1038, even though anything above 1000 should be enough.
65-
Fantom.unstable_advanceAnimationsByTime(1038);
64+
// TODO: this fails with any value below 1022, even though anything above 1000 should be enough.
65+
Fantom.unstable_advanceAnimationsByTime(1022);
6666
boundingClientRect = viewElement.getBoundingClientRect();
6767
expect(boundingClientRect.x).toBe(100);
6868

0 commit comments

Comments
 (0)