Attempt to fix gotestsum skipping tests by adding a prefix so that test output doesn't begin with panic:

This commit is contained in:
David Dworken 2023-10-21 17:03:04 -07:00
parent 50c6f5e061
commit b6885cca98
No known key found for this signature in database

View File

@ -79,7 +79,7 @@ func TestLoggerMiddlewareWithPanic(t *testing.T) {
}
func TestPanicGuard(t *testing.T) {
t.Skip("TODO: Re-enable this without it breaking gotestsum")
fmt.Println("Output prefix to avoid breaking gotestsum with panics")
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
panic(fmt.Errorf("synthetic panic for tests"))
})
@ -108,7 +108,7 @@ func TestPanicGuard(t *testing.T) {
}
func TestPanicGuardNoPanic(t *testing.T) {
t.Skip("TODO: Re-enable this without it breaking gotestsum")
fmt.Println("Output prefix to avoid breaking gotestsum with panics")
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
})