ios – How to add unit tests to a framework in xcode project?


I followed tutorials on how to modularize an app to adhere to clean architecture. I created for each layer (domain, data and presentation) a framework by

  • pressing on the project
  • then in targets pressing on the plus sign in the bottom
  • choosing framework

I have successfully managed to create the 3 frameworks and the app works as intended with these frameworks.

Now what the tutorials failed to cover is how to add unit tests for the frameworks.
I had ticked the option to include tests when creating the framework. But whatever test i add, the tests don’t run at all.

So the 2 questions that i have are:

1- How to add unit tests for frameworks? (What do i need to add or configure?)

2- Since data and domain layers don’t depend on UI at all is it possible to run their unit tests without launching the simulator? If so, what configuration do i need to set up?

Any help will be much appreciated. Thanks in advance!

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img