Fork me on GitHub

I'm looking to write some unit tests on reagent view functions which leverage re-frame subscriptions within. Is the right approach to stub/mock the re-frame subscriptions?


what are you trying to achieve by testing view functions?


I've yet to find a good reason to do it. I'm truly curious. It's not a criticism


here's one approach I tried, but found too cumbersome: I split up the view code into two functions, the second function being called with data I gathered from subscriptions. That makes the view part pure and trivially testable. That said, visual inspection of the views, mixed in with Devcards seems to be sufficient