Tour of SQLiteData: Advanced Testing

Video #353 • Feb 2, 2026 • Members Only

We clean up our test suite and make use of the expectDifference helper, for precisely describing changes to state in an exhaustive fashion. We will then rapidly add test coverage using the forthcoming “Point-Free Way” skills documents. Finally, we will achieve the seemingly impossible by writing a test against iCloud sharing!

Previous video
Tour of SQLiteData: Advanced Testing
Next video
Locked

Unlock This Video

Our Free plan includes 1 members only video of your choice, plus weekly updates from our newsletter.

Sign in with GitHub

Introduction

Brandon

Ok, we have now exercise more of our feature’s logic and behavior in a simple unit test. We can emulate the user tapping on various buttons and typing into text fields to add a new player to their game, and then we assert that indeed the game was added to the model’s state. We can now be very confident that this feature works when run in the simulator or on device, as long as the view is reading the state from the model to construct its hierarchy and as long as the view is calling the model’s methods when the user takes an action.

Stephen

Things are looking good, but there are some improvements we can make to this. We had to copy-and-paste quite a bit of set up code in that test just to get to a point where we could actually start emulating user behavior and making assertions. And the assertion itself was quite verbose. We are going to make both of those aspects much better, and we are going to take a look at how we can use AI to write a few more tests for us.

Let’s take a look.

Test improvements


References

Downloads

Get started with our free plan

Our free plan includes 1 members only episode of your choice, access to 75 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing