TESTING
An App With SCA: Flow Testing
How to completely test the execution flow of your app
This is the last article of a series on how to write an app with SwiftUI and the Composable Architecture by pointfree.co. You can find the other articles at the following links:
- An App With SCA: SwiftUI
- An App With SCA: Logic
- An App With SCA: Effect
- An App With SCA: State Testing
- An App With SCA: Environment
Last week we discussed how to export the dependencies of our Snake app to gain full control over our codebase. We also finalized the test of the state we were not able to finish a couple of weeks ago.
In the process of factoring out the dependencies, we worked on the timer, moving it from the Reducer
to the Environment
to have the possibility to control it. However, we did not use it in our tests.
Today, we complete the test of our app, showing an interesting property of the Composable Architecture Test Support: thanks to its ergonomic API, it is possible to fully test our app in a very simple way.
Our codebase so far
In order to properly understand our tests, let me report here the pieces of the…