MCPcopy Create free account
hub / github.com/kataras/iris / TestCompressionBeforeRecorder

Function TestCompressionBeforeRecorder

_examples/compression/main_test.go:40–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func 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
58func testBody(t *testing.T, req *httptest.Request, expectedReply interface{}) {
59 t.Helper()

Callers

nothing calls this directly

Calls 8

NewFunction · 0.92
testBodyFunction · 0.85
NewMethod · 0.80
RecordMethod · 0.80
NextMethod · 0.80
UseMethod · 0.65
GetMethod · 0.65
JSONMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…