github chaijs/chai 1.9.1
1.9.1 / 2014-03-19

latest releases: v5.1.0, v5.0.3, v5.0.2...
10 years ago

The following changes are required if you are upgrading from the previous version:

  • Users:
    • Migrate configuration options to new interface. (see notes)
  • Plugin Developers:
    • No changes required
  • Core Contributors:
    • Refresh node_modules folder for updated dependencies.

Configuration

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.

Quick Migration

// change this:
chai.Assertion.includeStack = true;
chai.Assertion.showDiff = false;

// ... to this:
chai.config.includeStack = true;
chai.config.showDiff = false;

All Config Options

config.includeStack

User configurable property, influences whether stack trace is included in
Assertion error message. Default of false suppresses stack trace in the error
message.

config.showDiff

User 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.

config.truncateThreshold (NEW)

User 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

Community Contributions

Thank you to all who took time to contribute!

Other Bug Fixes

  • #183 Allow undefined for actual. (internal api)
  • Update Karam(+plugins)/Istanbul to most recent versions.

Don't miss a new chai release

NewReleases is sending notifications on new releases.