Your First iOS & SwiftUI App: An App from Scratch, Episode 22: Intro to Unit Testing | raywenderlich.com

Learn how you can add unit tests to your app to automatically verify your app works the way you expect.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/28797163-your-first-ios-swiftui-app-an-app-from-scratch/lessons/22

Guys I am doing this lesson on 14 of June of 2022, and the test code isnโ€™t compiling, it says the object game needs to be an optional. I couldnโ€™t use the exclamation point.

This happened to me too, but I realized it was because I had initialized var game = Game! when it SHOULD be var game: Game! (colon vs equals sign).