Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspopp-wbd committed Nov 20, 2024
1 parent 9c28010 commit affa017
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions huma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,7 @@ Content of example2.txt.
func TestOpenAPI(t *testing.T) {
r, api := humatest.New(t, huma.DefaultConfig("Features Test API", "1.0.0"))

// Used to validate exclusion of embedded structs from response headers
type PaginationHeaders struct {
Link string `header:"link"`
}
Expand Down Expand Up @@ -1977,6 +1978,7 @@ func TestOpenAPI(t *testing.T) {

openapiBody := w.Body.String()
assert.Equal(t, 200, w.Code, openapiBody)
assert.Contains(t, openapiBody, "link")
assert.NotContains(t, openapiBody, "PaginationHeaders")
})
}
Expand Down

0 comments on commit affa017

Please sign in to comment.