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
- 13
- changes to make
- 0
- advisories fixed
- 13
- new
- 14
- fixes
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
- 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
.propertyassertion. 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.nestedflag. (Related Issues: #745, #743, PRs: #758, #757) - Breaking
Fix unstable behavior of the
NaNassertion. 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 isNaN(or not if the.notflag 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
truncateThresholdvalue on theconfig). (Related Issues: #441, PRs: #576)
- Breaking
5 other lines we could not sort, mostly version bumps
- 4.0.0
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
MapandSet, 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
deepflag now only ever does deep equality. Beforehand, it would sometimes also be used to test nested properties (for exampleexpect(foo).to.have.deep.property('bar.baz'). For nested assertions, please now use the.nestedflag. - 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
TypeErrormessages. - 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!
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.