WeTransfer / Mocker

Mock Alamofire and URLSession requests without touching your code implementation
MIT License
1.1k stars 96 forks source link

How can I mock a request only when needed? #156

Closed gzlboy closed 3 months ago

gzlboy commented 6 months ago

I integrated Mocker according to the documentation and found that all requests without register will also prompt "No mocked data found for url". Can URLs without register be requested directly?

github-actions[bot] commented 5 months ago

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.

bwhtmn commented 5 months ago

It sounds like you might be wanting to use the "opt in" mode, where the Mocker will only handle requests for URL that were registered, and all other requests will be handled normally. For example, you could add this line when setting up the mocker:

Mocker.mode = .optin
github-actions[bot] commented 4 months ago

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.