-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'does not include' assertion operator #29
base: master
Are you sure you want to change the base?
Conversation
…ontains the matched item path (index in the collection), useful for the
@pzavolinsky can you take a look? I'm not very experienced with that part of the code base to review. |
Scenario: {} does not include { "a": null } | ||
Given A is {} | ||
When asserting that A does not include { "a": null} | ||
Then the assertion fails with {} does include {"a":null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right, A
does not have a null
valued a
property so the assertion should pass.
@@ -0,0 +1,58 @@ | |||
Feature: compare JSON does not include X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should add compound operand tests for does not include
, stuff like:
{ "a": 1 } does not include { "a": 1, "b": 2 }
☝️ also what would be the right outcome of this? { "a": 1 }
certainly doesn't include the full { "a": 1, "b": 2 }
but it does include a part of it.
maybe we also need a does not overlap
operator that distinguishes between inclusion and intersection.
The negative version of
include
operator seems to be missing, this PR tries to add itfindOffendingItem
fn to utils so it can be reused in both Operations.subError
describes at which property therecursiveMatch
failed. But fordoes not include
failures, I just usederrorPath
.When
does not include
fails,errorPath
indicates at which index the occurrence was indeed found (took the same approach asis not
operator)