Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checks/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ func prettyPrintHTTPTest(test api.HTTPRequestTest, variables map[string]string)
}
if test.BodyContains != nil {
interpolated := InterpolateVariables(*test.BodyContains, variables)
return fmt.Sprintf("Expecting body to contain: %s", interpolated)
return fmt.Sprintf("Expecting response body to contain: %s", interpolated)
}
if test.BodyContainsNone != nil {
interpolated := InterpolateVariables(*test.BodyContainsNone, variables)
return fmt.Sprintf("Expecting JSON body to not contain: %s", interpolated)
return fmt.Sprintf("Expecting response body to not contain: %s", interpolated)
}
if test.HeadersContain != nil {
interpolatedKey := InterpolateVariables(test.HeadersContain.Key, variables)
Expand Down
4 changes: 2 additions & 2 deletions checks/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ func evaluateHTTPRequestTests(stepIndex int, req api.CLIStepHTTPRequest, result
case test.BodyContains != nil:
needle := InterpolateVariables(*test.BodyContains, result.Variables)
if !strings.Contains(result.BodyString, needle) {
err = fmt.Errorf("expected body to contain %q", needle)
err = fmt.Errorf("expected response body to contain %q", needle)
}
case test.BodyContainsNone != nil:
needle := InterpolateVariables(*test.BodyContainsNone, result.Variables)
if strings.Contains(result.BodyString, needle) {
err = fmt.Errorf("expected body to not contain %q", needle)
err = fmt.Errorf("expected response body to not contain %q", needle)
}
case test.HeadersContain != nil:
err = evaluateHeaderContains(result.ResponseHeaders, *test.HeadersContain, result.Variables, "header")
Expand Down