NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #458 most downloaded on npm
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
Last release 4 days ago
30 Sep 2026
Release timing varies
gaps range from 3 weeks to 9 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
111 releases · first in 2011
The following changes are required if you are upgrading from the previous version:
The following changes are required if you are upgrading from the previous version:
addChainableNoop notes below.node_modules folder for updated dependencies.The following assertions can now also be used in the function-call form:
The above list of assertions are property getters that assert immediately on access. Because of that, they were written to be used by terminating the assertion chain with a property access.
expect(true).to.be.true;
foo.should.be.ok;
This syntax is definitely aesthetically pleasing but, if you are linting your test code, your linter will complain with an error something like "Expected an assignment or function call and instead saw an expression." Since the linter doesn't know about the property getter it assumes this line has no side-effects, and throws a warning in case you made a mistake.
Squelching these errors is not a good solution as test code is getting to be just as important as, if not more than, production code. Catching syntactical errors in tests using static analysis is a great tool to help make sure that your tests are well-defined and free of typos.
A better option was to provide a function-call form for these assertions so that the code's intent is more clear and the linters stop complaining about something looking off. This form is added in addition to the existing property access form and does not impact existing test code.
expect(true).to.be.true();
foo.should.be.ok();
These forms can also be mixed in any way, these are all functionally identical:
expect(true).to.be.true.and.not.false();
expect(true).to.be.true().and.not.false;
expect(true).to.be.true.and.not.false;
If you would like to provide this function-call form for your terminating assertion properties, there is a new function to register these types of asserts. Instead of using addProperty to register terminating assertions, simply use addChainableNoop instead; the arguments to both are identical. The latter will make the assertion available in both the attribute and function-call forms and should have no impact on existing users of your plugin.
-0. @dasilvacontinThank you to all who took time to contribute!
One column per quarter.
The following changes are required if you are upgrading from the previous version:
The following changes are required if you are upgrading from the previous version:
node_modules folder for updated dependencies.Thank you to all who took time to contribute!
The following changes are required if you are upgrading from the previous version:
The following changes are required if you are upgrading from the previous version:
node_modules folder for updated dependencies.There have been requests for changes and additions to the configuration mechanisms
and their impact in the Chai architecture. As such, we have decoupled the
configuration from the Assertion constructor. This not only allows for centralized
configuration, but will allow us to shift the responsibility from the Assertion
constructor to the assert interface in future releases.
These changes have been implemented in a non-breaking way, but a depretiation
warning will be presented to users until they migrate. The old config method will
be removed in either v1.11.0 or v2.0.0, whichever comes first.
// change this:
chai.Assertion.includeStack = true;
chai.Assertion.showDiff = false;
// ... to this:
chai.config.includeStack = true;
chai.config.showDiff = false;
falseUser configurable property, influences whether stack trace is included in
Assertion error message. Default of false suppresses stack trace in the error
message.
trueUser configurable property, influences whether or not the showDiff flag
should be included in the thrown AssertionErrors. false will always be false;
true will be true when the assertion has requested a diff be shown.
40User configurable property, sets length threshold for actual and expected values in assertion errors. If this threshold is exceeded, the value is truncated.
Set it to zero if you want to disable truncating altogether.
chai.config.truncateThreshold = 0; // disable truncating
contain/include 1.9.0 regression. @leiderssfi for assert interface. @refackThank you to all who took time to contribute!
undefined for actual. (internal api)The following changes are required if you are upgrading from the previous version:
The following changes are required if you are upgrading from the previous version:
node_modules folder for updated dependencies.--watch. @demandshas to language chains. @duncanbeevers{a:1,b:2}.should.include({a:1}) @jkrosoThank you to all who took time to contribute!
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →