Skip to content

v1.7.0

Choose a tag to compare

@steinfletcher steinfletcher released this 27 Oct 09:53
· 2 commits to master since this release
364a2ba

Bug fix release with one addition to the exported API: MockRequest.URL and URLf. No breaking API changes.

New

  • MockRequest.URL and URLf set the URL of a mock started with Method, for methods without a helper such as OPTIONS: 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 from Query, QueryParams and QueryCollection, 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 with EndStandalone or NewStandaloneMocks(...).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 Method and no URL no longer panics when a request is matched against it, or when Result.UnmatchedMocks reports 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/compress 1.18.7. (#180)