> Close the door to other interesting parts lik...
# compose
l
Close the door to other interesting parts like testing
IMO this is a bit of a jump in logic. The assumption here is that asserting on the returned “virtual DOM” of components is the right and only way to test those components. I disagree on both counts. With the right APIs exposed, Compose will be as testable as anything else and we will push you into the “pit of success” of testing the public API of components instead of their implementation details. The way we have tests structured in the repo right now are not representative of what a testing solution for compose will look like. It’s easy to make a rush judgement about whether Unit-returning functions was a good idea or not. Trust me, I was quick to dismiss them as well when the design was first discussed! I slowly came to the realization that there are a lot of benefits to doing so and it’s now one of the design decisions that I’m most confident in.
👍 20
👏 3