Skip to content

Commit

Permalink
Add support for contains operator (#63)
Browse files Browse the repository at this point in the history
* add support for contains op

* bump version v.12.0
  • Loading branch information
wagslane authored Dec 18, 2024
1 parent d5a5ebb commit 3884101
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/lessons.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type OperatorType string
const (
OpEquals OperatorType = "eq"
OpGreaterThan OperatorType = "gt"
OpContains OperatorType = "contains"
)

type HTTPTestJSONValue struct {
Expand Down
2 changes: 2 additions & 0 deletions render/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ func prettyPrintHTTPTest(test api.HTTPTest, variables map[string]string) string
op = "to be equal to"
} else if test.JSONValue.Operator == api.OpGreaterThan {
op = "to be greater than"
} else if test.JSONValue.Operator == api.OpContains {
op = "contains"
}
expecting := fmt.Sprintf("Expecting JSON at %v %s %v", test.JSONValue.Path, op, val)
return checks.InterpolateVariables(expecting, variables)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.11.1
v1.12.0

0 comments on commit 3884101

Please sign in to comment.