v3.0.0
Hamjest 3.0 brings several minor breaking changes compared to Hamjest 2.x – see the list in the readme for details.
Improvements
- Much better mismatch descriptions!
- Support for indentation when building nested messages. Many matchers use this to better format their sub-matcher’s error descriptions.
- Custom formatting for DOM nodes (and DOM-like objects) in mismatch descriptions to make assertion errors involving the DOM easier to read and understand.
hasProperty
andhasProperties
now have a verbose mode – enabled with__.hasProperties({…}).verbose()
– that appends a description of the whole object after the mismatch description. Useful for debugging failing tests that receive totally unexpected object types.
- New matchers
inRange
hasExactlyOneItem
- New alias
empty
forisEmpty
to improve grammar in some use cases:__.promiseThat(promisedArray, __.willBe(__.empty()))
- Switched from Q to Bluebird for faster tests and better sugar methods.