Writing unit test cases for functions using mock data where https url requests are made. After some success tests it stuck in waiting and finally fail because of time out. May be because number of threads are created around 265. Can someone suggest how to fix this. below is the test case how it is being used.
func testRefreshSuccess() {
let mockExpectation = expectation(description: "Get detail mock should be called")
let requestURL = BaseUrl + getAssetDetailAPI + testAssetId
let mockDataUsage = FileReader.contentsOfFileInBundle("Details")!
let mockUsage = Mock(url: URL(string: requestURL)!, dataType: .json, statusCode: 200, data: [.get: mockDataUsage])
mockUsage.register()
Writing unit test cases for functions using mock data where https url requests are made. After some success tests it stuck in waiting and finally fail because of time out. May be because number of threads are created around 265. Can someone suggest how to fix this. below is the test case how it is being used.
func testRefreshSuccess() { let mockExpectation = expectation(description: "Get detail mock should be called") let requestURL = BaseUrl + getAssetDetailAPI + testAssetId let mockDataUsage = FileReader.contentsOfFileInBundle("Details")! let mockUsage = Mock(url: URL(string: requestURL)!, dataType: .json, statusCode: 200, data: [.get: mockDataUsage]) mockUsage.register()