npm / chai
chai
What changed in chai 5 to 6, from its official release notes, upgrade guides and advisories. Also covers @types/chai. Sources checked 2026-11-30.
6 breaking1 new APIs and options1 behavior and defaults1 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initchai 610 changes
Breaking changes 2
Iterable assertions require iterators to be callable.
The unbundled lib/*.js files are no longer present; code importing them directly must change to import ./index.js.
New APIs and options 1
More utility type definitions are available to developers using Chai's types.
Behavior and default changes 1
Deep include oneOf assertions are supported.
Tooling 1
Chai's build target is now es2021 to support Safari versions earlier than 16.4.
Fixes and other changes 5
The change assertion's JSDoc types are corrected, and it handles 0 and empty string.
The keys() assertion considers only unique expected keys.
Literal template tags are preserved in assertion values.
The failure message for not.deep.oneOf now includes the not modifier.
Avoids a BigInt literal in closeTo for runtime compatibility.
chai 54 changes
Breaking changes 4
Chai supports only ESM; use import statements or dynamic import instead of require('chai').
Internet Explorer is no longer supported.
Minimum supported versions are now Firefox 100, Safari 14.1, Chrome 100, and Edge 100; older browsers receive best-effort support.
NodeJS versions below 18 are no longer supported.