Skip to content

v3.0.0

Compare
Choose a tag to compare
@rluba rluba released this 29 May 08:02
· 134 commits to master since this release

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 and hasProperties 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 for isEmpty to improve grammar in some use cases:
    __.promiseThat(promisedArray, __.willBe(__.empty()))
  • Switched from Q to Bluebird for faster tests and better sugar methods.