Skip to content

Commit

Permalink
fix: Mocked should not resolve requests (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: danthorpe <[email protected]>
  • Loading branch information
danthorpe and danthorpe authored Oct 31, 2023
1 parent d0b0d09 commit 65bea73
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/TestSupport/Mocked.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ struct Mocked: NetworkingModifier {
self.stub = stubbedResponse
}

func resolve(upstream: NetworkingComponent, request: HTTPRequestData) -> HTTPRequestData {
request // Note: We actually do not want to resolve the request to be mocked
}

func send(upstream: NetworkingComponent, request: HTTPRequestData) -> ResponseStream<
HTTPResponseData
> {
Expand Down Expand Up @@ -55,6 +59,10 @@ extension NetworkingComponent {
struct CustomMocked: NetworkingModifier {
let block: @Sendable (NetworkingComponent, HTTPRequestData) -> ResponseStream<HTTPResponseData>

func resolve(upstream: NetworkingComponent, request: HTTPRequestData) -> HTTPRequestData {
request // Note: We actually do not want to resolve the request to be mocked
}

func send(upstream: NetworkingComponent, request: HTTPRequestData) -> ResponseStream<
HTTPResponseData
> {
Expand Down

0 comments on commit 65bea73

Please sign in to comment.