Bonus Content
Chapter Exercises Solutions
- Chapter 5, Changing Tests with Fixtures
- Chapter 6: Testing Static SwiftUI Views — Exercise Solution (Coming Soon)
- Chapter 7: Testing Dynamic SwiftUI Views
- Chapter 8: Testing Code Based on Indirect Inputs
- Chapter 9: Testing JSON
- Chapter 10: Testing Network Code – Part 1: TDD base URL with Stub
- Chapter 10: Testing Network Code – Part 2: TDD base URL with Spy
- Chapter 10: Testing Network Code – Part 3: Keep multiple endpoints tidy
- Chapter 11: Injecting Dependencies with
@EnvironmentObject— Exercise Solution (Coming Soon) - Chapter 12: Testing Side Effects
- Chapter 13: Testing Conditional View Presentation — Exercise Solution (Coming Soon)
- Chapter 14: Fixing Bugs with TDD — Exercise Solution (Coming Soon)
- Chapter 15: Fakes and Dummies — Exercise Solution (Coming Soon)
Improvements and alternative implementations
- How to model the state with
RemoteData - Network testing with OHHTTPStubs
- Migrating tests from XCTest to Swift Testing (Coming Soon)
- Swift Testing patterns not in the book: tags, traits, parameterised tests (Coming Soon)
- Modern alternatives to OHHTTPStubs: Mocker and URLProtocol (Coming Soon)
Swift Packages from the book
- swift-collection-if-in-bounds – Adds a subscript operator to
Arrayand otherCollectiontypes to returnOptional.noneinstead of crashing when the given index is out of bounds. - RemoteData – Fine-grained
enumto describe the state of networking operations. - MinimalNetworking – Network abstraction layer based on the work from the book.