-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
Unexpected meaning of deep
flag in property
assertion
#745
Comments
That's a great idea, I think this is the optimal choice since we can maintain both behaviors and allow users to chose whatever they want to do. I'm +1 for that. Awesome job. |
The main problem is that this is a huge breaking change for anyone using |
@meeber Yes, I totally agree, but I think that's the whole point of doing semantic versioning. IMO that's the cost of moving forward, and the behavior you just proposed looks much better than what we currently have, that was a great idea I would like to have access to if I were a user. Whenever 4.0.0 gets released we can also prepare a migration guide for anyone willing to update an old codebase. I also would love to hear what @keithamus thinks. 😄 |
There's an inconsistency with the meaning of the
deep
flag. Consider these examples:The reason the last example fails is because the
deep
flag has a different meaning when applied to the.property
assertion than it does when applied to any other assertion. Instead of switching from strict to deep equality, thedeep
flag unlocks the ability for the developer to use dot or bracket notation in their.property
assertion:That's pretty cool, but the inconsistency of the
deep
flag creates a confusing developer experience and brings sadness to my soul. It also makes it impossible for other assertions such as.include
to internally leverage.property
by passing along thedeep
flag, as noted in #743 (comment).I propose the following breaking change:
deep
flag perform a deep equality comparison when used with the.property
assertion.nested
orinner
flag to inherit the old behavior of thedeep
flag, allowing dot or bracket notation in the.property
assertion.Examples:
The text was updated successfully, but these errors were encountered: