You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each response can optionally be given a `delivery` parameter that controls when the response is delivered to the client. The default value of the parameter is `.instant`.
161
+
162
+
-`.instant`: The response is delivered immediately (default behavior).
163
+
-`.delayed(TimeInterval)`: The response is delayed and delivered after the specified number of seconds.
MockResponse.plaintext("delayed response", delivery: .delayed(2.0)) // delivered after 2 seconds
170
+
```
171
+
159
172
## Handling unmocked requests
160
173
By default, unmocked requests return a hardcoded 404 response with a small body. You can configure `HTTPMock.unmockedPolicy` to control this behavior, choosing between returning a 404 or allowing the request to pass through to the real network. The default is `notFound`, aka. the hardoced 404 response.
161
174
@@ -223,7 +236,7 @@ Path("/user") {
223
236
## Goals
224
237
-[X] Allow for passthrough networking when mock hasn't been registered for the incoming URL.
225
238
-[X] Let user point to a file that should be served.
226
-
-[] Set delay on requests.
239
+
-[X] Set delay on requests.
227
240
-[ ] Let user configure a default "not found" response. Will be used either when no matching mocks are found or if queue is empty.
228
241
-[ ] Create separate instances of `HTTPMock`. The current single instance requires tests to be run in sequence, instead of parallel.
229
242
-[ ] Does arrays in query parameters work? I think they're being overwritten with the current setup.
0 commit comments