Skip to content

4.0.0

Compare
Choose a tag to compare
@domenic domenic released this 22 Sep 00:15
· 79 commits to master since this release

This release is a complete rewrite of Chai as Promised's internals for better compatibility, speed, and robustness. If Chai as Promised has seemed weirdly broken in the past, it's probably fixed now.

Notable user-facing changes and fixes include:

  • You can now use multiple asserters on a single promise without problems, e.g. promise.should.have.property("foo").that.equals("bar").
  • When using the assert interfaces, rejected promises now pass through any assertion messages in addition to the rejection reason.
  • Removed .rejected.with syntax, in favor of a new .rejectedWith. Juggling the state between the two separate asserters (.rejected and .with) was very error-prone and didn't always work right.
  • Removed .broken alias for .rejected; nobody says that anymore.
  • The test to disallow jQuery “promises” has been tightened to produce less false positives. In particular, promise-stream hybrids with both .pipe and .then methods should work fine, unless they duplicate the entire jQuery-“promise” interface.
  • Fixed .rejectedWith on promises whose reasons are not Error instances (even though you should always reject with Error instances).
  • Fixed using .rejectedWith plus .notify on asynchronously-rejected promises.