(t *testing.T)
| 20 | } |
| 21 | |
| 22 | func TestResolvedMiddleware(t *testing.T) { |
| 23 | t.Parallel() |
| 24 | |
| 25 | tests := []struct { |
| 26 | middleware echo.MiddlewareFunc |
| 27 | kind fxhttpserver.MiddlewareKind |
| 28 | }{ |
| 29 | {testMiddlewareFunc, fxhttpserver.GlobalUse}, |
| 30 | {testMiddlewareFunc, fxhttpserver.GlobalPre}, |
| 31 | {testMiddlewareFunc, fxhttpserver.Attached}, |
| 32 | } |
| 33 | |
| 34 | for _, tt := range tests { |
| 35 | tt := tt |
| 36 | |
| 37 | t.Run(tt.kind.String(), func(t *testing.T) { |
| 38 | t.Parallel() |
| 39 | |
| 40 | rm := fxhttpserver.NewResolvedMiddleware(tt.middleware, tt.kind) |
| 41 | |
| 42 | assert.Equal(t, "custom error", rm.Middleware()(testHandlerFunc)(nil).Error()) |
| 43 | assert.Equal(t, tt.kind, rm.Kind()) |
| 44 | }) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func TestResolvedHandler(t *testing.T) { |
| 49 | t.Parallel() |
nothing calls this directly
no test coverage detected