Packages

chai

6.3.0 · 30 Sep 2026MIT222.3M / weekRepositoryHomepagenpmAtom feed

Upgrading chai From 3.5.0 to 4.0.0

1 release in betweenevery note read

Other targets from 3.5.0Latest6.3.0
  1. 3.5.0yours
  2. 4.0.0target

Before you upgrade

Tick each one off as you go
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0

Release by release

  1. 4.0.0

    Migration needed26 May 201713 new · 14 fixes
    • Breaking

      We no longer support Node v0.10 and v0.12 (since their LTS has ended) (PRs: #816, #901)

    • Breaking

      Instead of allowing the user to write the path of a property, now the deep flag performs a deep equality comparison when used with the .property assertion. If you want the old behavior of using the dot or bracket notation to denote the property you want to assert against you can use the new .nested flag. (Related Issues: #745, #743, PRs: #758, #757)

    • Breaking

      Fix unstable behavior of the NaN assertion. Now we use the suggested ES6 implementation. The new implementation is now more correct, strict and simple. While the old one threw false positives, the new implementation only checks if something is NaN (or not if the .not flag is used) and nothing else. (Related Issues: #498, #682, #681, PRs: #508)

    • Breaking

      The Typed Array types are now truncated if they're too long (in this case, if they exceed the truncateThreshold value on the config). (Related Issues: #441, PRs: #576)

5 other lines we could not sort, mostly version bumps
  • Almost all documentation has been rewritten, with detailed instructions on how assertions work, which flags they can be combined with and the best practices for how to use them.

    4.0.0
  • Deep equality has been rewritten from the ground up to support ES6 types like Map and Set, and better support existing types. It is now also much, much faster than before and allows us to bring some great improvements in upcoming releases.

    4.0.0
  • We have made sure the deep flag now only ever does deep equality. Beforehand, it would sometimes also be used to test nested properties (for example expect(foo).to.have.deep.property('bar.baz'). For nested assertions, please now use the .nested flag.

    4.0.0
  • Many assertions have become more strict, which means you get better error messages explaining where things have gone wrong. For the most part, this wont mean error messages where there weren't error messages before, but it will mean better error messages to replace the, sometimes cryptic, default TypeError messages.

    4.0.0
  • We've added detections and helpful error messages for common mistakes and typos. The error messages will, in some cases, point you to documentation or in other cases suggest alternatives. These messages will continue to be improved in future releases, so let us know if you have any suggestions!

    4.0.0

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.