WeTransfer/Mocker

The "Empty Responses" example doesn't work: No exact matches in call to initializer

DominikPalo opened this issue · 2 comments

I'm trying to mock empty responses according to the example provided in the readme file, but it seems the code snippet is not compatible with the latest version (3.0.1) of the framework. There is a line:

let mock = Mock(request: request, statusCode: 204)

which prevents Xcode from building the app, as there is no such initializer on the Mock structure: No exact matches in call to initializer

Noticed the same issue. How about using an empty Data object? Worked for me with Alamofire

let empty = Data()
let mock = Mock(url: url, dataType: .json, statusCode: 204, data: [.delete : empty])
mock.register()

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.