fossteams-api/pkg/errors/generic_http_error_test.go
copilot-swe-agent[bot] 631c192034
feat: add Bun JS port
2026-06-04 13:44:27 +00:00

12 lines
449 B
Go

package errors
import "testing"
func TestGenericHTTPErrorString(t *testing.T) {
if got := NewHTTPError(200, 401, nil).Error(); got != "invalid status code returned: 200 expected but 401 returned" {
t.Fatalf("unexpected error string: %s", got)
}
if got := NewHTTPError(200, 500, []byte("boom")).Error(); got != "invalid status code returned: 200 expected but 500 returned: boom" {
t.Fatalf("unexpected error string with body: %s", got)
}
}