Skip to content

Commit

Permalink
add http test bodyContainsNone (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
skovranek authored Nov 4, 2024
1 parent 68b1197 commit a8bb5a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions client/lessons.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ type ResponseVariable struct {

// Only one of these fields should be set
type HTTPTest struct {
StatusCode *int
BodyContains *string
HeadersContain *HTTPTestHeader
JSONValue *HTTPTestJSONValue
StatusCode *int
BodyContains *string
BodyContainsNone *string
HeadersContain *HTTPTestHeader
JSONValue *HTTPTestJSONValue
}

type OperatorType string
Expand Down
3 changes: 3 additions & 0 deletions render/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ func prettyPrintHTTPTest(test api.HTTPTest) string {
if test.BodyContains != nil {
return fmt.Sprintf("Expecting JSON body to contain: %s", *test.BodyContains)
}
if test.BodyContainsNone != nil {
return fmt.Sprintf("Expecting JSON body to not contain: %s", *test.BodyContainsNone)
}
if test.HeadersContain != nil {
return fmt.Sprintf("Expecting header to contain: '%s: %v'", test.HeadersContain.Key, test.HeadersContain.Value)
}
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.10.2
v1.11.0

0 comments on commit a8bb5a5

Please sign in to comment.