Skip to content

3.4.0 / 2015-10-21

Compare
Choose a tag to compare
@keithamus keithamus released this 21 Oct 11:12

This release improves some confusing error messages, and adds some new assertions. Key points:

  • Feature: New assertion: expect(1).oneOf([1,2,3]) - for asserting that a given value is one of a set.
  • Feature: .include() (and variants) will now give better error messages for bad object types. Before expect(undefined).to.include(1) would say "expected undefined to include 1", now says "object tested must be an array, an object, or a string but undefined given"
  • Feature: .throw() (and variants) can now better determine the Error types, for example expect(foo).to.throw(node_assert.AssertionError) now works.
  • Feature: .closeTo is now aliased as .approximately
  • BugFix: .empty changes from 3.3.0 have been reverted, as they caused breaking changes to arrays which manually set keys.

Community Contributions

Code Features & Fixes

  • #503 Checking that argument given to expect is of the right type when using with include. By @astorije
  • #446 Make chai able to cope with AssertionErrors raised from node's assert. By @danielbprice
  • #527 Added approximately alias to close to. By @danielbprice
  • #534 expect(inList).to.be.oneOf assertion. By @Droogans
  • #538 Revert .empty assertion change from PR #499. By @tusbar

Documentation fixes