Repository navigation
v1.7.0
Bug fix release with one addition to the exported API: MockRequest.URL and URLf. No breaking API changes.
New
MockRequest.URLandURLfset the URL of a mock started withMethod, for methods without a helper such asOPTIONS:apitest.NewMock().Method(http.MethodOptions).URL("http://users/api/user"). (#183)
Bug fixes
- A query string written into the request URL, as in
Get("/articles?page=2"), is now sent. It was replaced by the parameters fromQuery,QueryParamsandQueryCollection, so it was dropped even when none were set. Builder parameters are now appended to it. (#181) Times(n)now applies to standalone mocks installed withEndStandaloneorNewStandaloneMocks(...).End(), which previously answered one call each. Standalone mode still does not report a mock that is called fewer times than expected. (#182)- A mock started with
Methodand no URL no longer panics when a request is matched against it, or whenResult.UnmatchedMocksreports it. It now matches any URL. (#183)
Upgrading
Tests that wrote a query string into the URL now send it to the handler, which can change what the handler sees.
Examples
- Dependency bump in
examples/:github.com/klauspost/compress1.18.7. (#180)