gitea/modules/web
wxiaoguang 819aed35bf
Make route middleware/handler mockable (#25766)
To mock a handler:

```go
web.RouteMock(web.MockAfterMiddlewares, func(ctx *context.Context) {
	// ...
})
defer web.RouteMockReset()
```


It helps:

* Test the middleware's behavior (assert the ctx.Data, etc)
* Mock the middleware's behavior (prepare some context data for handler)
* Mock the handler's response for some test cases, especially for some
integration tests and e2e tests.
2023-07-09 12:25:53 +00:00
..
middleware Replace `interface{}` with `any` (#25686) 2023-07-04 18:36:08 +00:00
routing Replace `interface{}` with `any` (#25686) 2023-07-04 18:36:08 +00:00
types
handler.go
route.go Make route middleware/handler mockable (#25766) 2023-07-09 12:25:53 +00:00
route_test.go
routemock.go Make route middleware/handler mockable (#25766) 2023-07-09 12:25:53 +00:00
routemock_test.go Make route middleware/handler mockable (#25766) 2023-07-09 12:25:53 +00:00