MCPcopy
hub / github.com/pocketbase/pocketbase / TestEventInternalServerError

Function TestEventInternalServerError

tools/router/event_test.go:739–748  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

737}
738
739func TestEventInternalServerError(t *testing.T) {
740 err := new(router.Event).InternalServerError("message_test", map[string]any{"a": validation.Required, "b": "test"})
741
742 result, _ := json.Marshal(err)
743 expected := `{"data":{"a":{"code":"validation_invalid_value","message":"Invalid value."},"b":{"code":"validation_invalid_value","message":"Invalid value."}},"message":"Message_test.","status":500}`
744
745 if string(result) != expected {
746 t.Errorf("Expected\n%s\ngot\n%s", expected, result)
747 }
748}
749
750func TestEventBindBody(t *testing.T) {
751 type testDstStruct struct {

Callers

nothing calls this directly

Calls 1

InternalServerErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…