Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Mock requests for testing #28

Open
jessegrosjean opened this issue Apr 7, 2021 · 0 comments
Open

Mock requests for testing #28

jessegrosjean opened this issue Apr 7, 2021 · 0 comments

Comments

@jessegrosjean
Copy link

jessegrosjean commented Apr 7, 2021

I'm trying to Mock endpoints with Squid and Mocker.

Here's the basic pattern of what I think I want to do:

import Mocker
import Squid

extension HttpService {
    func mock<R>(request: R, statusCode: Int = 200, data: [Mock.HTTPMethod : Data]) where R: Request {
        Mock(url: ..., dataType: .json, statusCode: statusCode, data: data)
    }
}

The problem I'm not sure how to generate a final URL from a Squid Request and Squid HttpService. I know it does this internally, but I can't figure how to to make it generate the URL myself. Is there some method that I'm overlooking? Or is this something that could be added?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant