mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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. |
2 years ago | |
---|---|---|
.. | ||
middleware | 2 years ago | |
routing | 2 years ago | |
types | 2 years ago | |
handler.go | 2 years ago | |
route.go | 2 years ago | |
route_test.go | 2 years ago | |
routemock.go | 2 years ago | |
routemock_test.go | 2 years ago |