Repository navigation
Releases
Releases · nicandcranny/go-http-test
v0.6.0
- Bump Go version
- Add InFlight and WaitUntilIdle function
Full Changelog: v0.5.0...v0.6.0
v0.5.0
Add Keyed mode
- Simple mode — one handler per route. Perfect for a single test (or a
sequential suite): register a handler, make the request, assert the calls.
This is also perfect for static endpoint that always returns the same result
in every test.
UseRegisterHandler,GetNCalls,GetCalls,ResetCalls. - Keyed mode — one route, many per-request buckets. Use this when you want to
run tests in parallel against the same route and return a different response
for different requests. Each request is routed to a bucket by a key you
derive from the request (e.g. a user id, a client id, a channel), so each
parallel test owns its own handler and its own recorded calls with no
cross-test interference. UseRegisterKeyedRoute+RegisterKeyedHandler,
GetNCallsByKey,GetCallsByKey,ResetCallsByKey.
| Simple mode (single test) | Keyed mode (parallel-safe) |
|---|---|
RegisterHandler |
RegisterKeyedRoute + RegisterKeyedHandler |
GetNCalls(method, path) |
GetNCallsByKey(method, path, key) |
GetCalls(method, path) |
GetCallsByKey(method, path, key) |
ResetCalls() (all buckets) |
ResetCallsByKey(method, path, key) |
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Add simplified response function, e.g. w.JSON(http.StatusOk, resBody)
Full Changelog: v0.3.0...v0.4.0
v0.3.0
- Migrate to use echo to optimize the re-register handler logic
- Add log capability
- Minor bug fix
Full Changelog: v0.2.0...v0.3.0
v0.2.0
- Add request storer
- Use gin
Full Changelog: v0.1.3...v0.2.0
Fix Race Condition on Increment N Calls
Full Changelog: v0.1.2...v0.1.3
v0.1.2
Fix register handler bug
Full Changelog: v0.1.1...v0.1.2
v0.1.1
Add Mutex
Full Changelog: v0.1.0...v0.1.1