1

We are dividing our code into feature frameworks which contain the SwiftUI code as well as the view models. We are unit testing all of the view models and want to generate an accurate code coverage metric yet the number is low due to all the existing SwiftUI code in the framework. Is there a way to exclude UI code from being counted towards the code coverage metric? We do not want to introduce any additional third party frameworks to accomplish this. Do I need to create a separate target that only contains the view models then run the tests there and get the code coverage?

kschins
  • 1,054
  • 1
  • 13
  • 26

0 Answers0