(t *testing.T)
| 217 | } |
| 218 | |
| 219 | func TestRenderJsonpJSONError2(t *testing.T) { |
| 220 | w := httptest.NewRecorder() |
| 221 | data := map[string]any{ |
| 222 | "foo": "bar", |
| 223 | } |
| 224 | (JsonpJSON{"", data}).WriteContentType(w) |
| 225 | assert.Equal(t, "application/javascript; charset=utf-8", w.Header().Get("Content-Type")) |
| 226 | |
| 227 | e := (JsonpJSON{"", data}).Render(w) |
| 228 | require.NoError(t, e) |
| 229 | |
| 230 | assert.JSONEq(t, "{\"foo\":\"bar\"}", w.Body.String()) |
| 231 | assert.Equal(t, "application/javascript; charset=utf-8", w.Header().Get("Content-Type")) |
| 232 | } |
| 233 | |
| 234 | func TestRenderJsonpJSONFail(t *testing.T) { |
| 235 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected