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

Mock requests for testing #28

@jessegrosjean

Description

@jessegrosjean

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions