Skip to content

Commit a8bb5a5

Browse files
authored
add http test bodyContainsNone (#59)
1 parent 68b1197 commit a8bb5a5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

client/lessons.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ type ResponseVariable struct {
1212

1313
// Only one of these fields should be set
1414
type HTTPTest struct {
15-
StatusCode *int
16-
BodyContains *string
17-
HeadersContain *HTTPTestHeader
18-
JSONValue *HTTPTestJSONValue
15+
StatusCode *int
16+
BodyContains *string
17+
BodyContainsNone *string
18+
HeadersContain *HTTPTestHeader
19+
JSONValue *HTTPTestJSONValue
1920
}
2021

2122
type OperatorType string

render/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ func prettyPrintHTTPTest(test api.HTTPTest) string {
250250
if test.BodyContains != nil {
251251
return fmt.Sprintf("Expecting JSON body to contain: %s", *test.BodyContains)
252252
}
253+
if test.BodyContainsNone != nil {
254+
return fmt.Sprintf("Expecting JSON body to not contain: %s", *test.BodyContainsNone)
255+
}
253256
if test.HeadersContain != nil {
254257
return fmt.Sprintf("Expecting header to contain: '%s: %v'", test.HeadersContain.Key, test.HeadersContain.Value)
255258
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.10.2
1+
v1.11.0

0 commit comments

Comments
 (0)