(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestCompressionBeforeRecorder(t *testing.T) { |
| 41 | var expectedReply = payload{Username: "Makis"} |
| 42 | |
| 43 | app := iris.New() |
| 44 | app.Use(iris.Compression) |
| 45 | app.Use(func(ctx iris.Context) { |
| 46 | ctx.Record() |
| 47 | ctx.Next() |
| 48 | }) |
| 49 | |
| 50 | app.Get("/", func(ctx iris.Context) { |
| 51 | ctx.JSON(expectedReply) |
| 52 | }) |
| 53 | |
| 54 | e := httptest.New(t, app) |
| 55 | testBody(t, e.GET("/"), expectedReply) |
| 56 | } |
| 57 | |
| 58 | func testBody(t *testing.T, req *httptest.Request, expectedReply interface{}) { |
| 59 | t.Helper() |
nothing calls this directly
no test coverage detected
searching dependent graphs…