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
Support Immutable with chai's property assertions #43
Conversation
Waouh @scottnonnenberg, thanks a lot for this, it looks like tremendous work! As a matter of fact, this is something I wanted to tackle fairly soon as I saw different requests about it coming up. Hey what the hell @coveralls, you commenting here is supposed to be disabled! |
Ping! :0) |
@@ -540,5 +540,97 @@ | |||
assert.sizeOf = function (collection, expected) { | |||
new Assertion(collection).size(expected); | |||
}; | |||
|
|||
/** | |||
* ### .property(path, value) |
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.
For alphabetical sorting consistency, would you mind moving this addition between keys
and size
, in the BDD reference section of the code please?
Hey @scottnonnenberg, sorry for being silent, busy and all. The biggest thing I need to address with you is the format of the deep properties.
Depending on these questions, I think we could either switch to the dot/bracket-notation or, if the |
Quick |
Great work, @scottnonnenberg! Could you squash your commits into one commit before I can merge, please? |
Reorder methods for proper alphabetical sorting Remove msg parameter Match isIterable check with other methods in file property() - Add an array index deep property test property: Support string deep property syntax Fix alphabetical in tests More test reordering
Squash complete! |
Awesome, 👍 and merging! |
Hello both, Fantastic work ! |
@JalilArfaoui Will do ASAP, I need to update the doc first. Stay tuned 😄 |
@JalilArfaoui, this was finally released in v1.6.0: https://github.com/astorije/chai-immutable/releases/tag/v1.6.0 |
Property and deep property assertions, because I really like that syntax when I use
chai
with plain objects. :0)Based on original
property()
here: https://github.com/chaijs/chai/blob/8e8a728921085351ecd050cd606b2ef6a1fb1338/lib/chai/core/assertions.js#L881Like other methods in
chai-immutable
, falls back to original chai methods if the target object is notisIterable()
.100% code coverage for newly-added code. Also, I noticed that changing
chai.config.truncateThreshold
can make display of Immutable objects a lot nicer.