(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestHTMLBadDisableHTTPErrorRendering(t *testing.T) { |
| 34 | render := New(Options{ |
| 35 | Directory: "testdata/basic", |
| 36 | DisableHTTPErrorRendering: true, |
| 37 | }) |
| 38 | |
| 39 | var err error |
| 40 | |
| 41 | h := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
| 42 | err = render.HTML(w, http.StatusOK, "nope", nil) |
| 43 | }) |
| 44 | |
| 45 | res := httptest.NewRecorder() |
| 46 | req, _ := http.NewRequestWithContext(ctx, http.MethodGet, "/foo", nil) |
| 47 | h.ServeHTTP(res, req) |
| 48 | |
| 49 | expectNotNil(t, err) |
| 50 | expect(t, res.Code, 200) |
| 51 | expect(t, res.Body.String(), "") |
| 52 | } |
| 53 | |
| 54 | func TestHTMLBasic(t *testing.T) { |
| 55 | render := New(Options{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…