facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

How to test? #340

Open alessandroorru opened 8 years ago

alessandroorru commented 8 years ago

How do you unit test the animation in the real world?

Let's say I have an animation that transitions between two different states of a view. I would like to check if the two states are fine at the beginning and at the end of the animation, but I don't have a way to do that without introducing delays in my unit test, and moreover it isn't really reliable.

IMHO a solution could be to introduce a flag in POPAnimation that simply disables the animations all together, and simply sets the property to their final states. In this way, the test could be run synchronously on a single thread, and the checks would be trivial.

What is your approach, and eventually what do you think about my solution?