Domanda

I'm using Nocilla to stub HTTP requests and it is working ok. I can stub the requests, return json fixtures and assert over it. The problem is that the application runs when the test starts and some requests are made on the viewDidLoad of the first view controller which cause an exception on Nocilla. How I can prevent the application from running since I only want the test code to be executed?

PS: I don't want to stub all the requests because I'm testing them!

È stato utile?

Soluzione

I managed to find the solution. These kind of tests should be run in logic tests target instead of application test target which uses the application. More documentation of the differences and how to create a logic test target can be found here.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top