3.9 KiB
Release Notes
1.5.0 / 2013-02-03
Migration Requirements
The following changes are required if you are upgrading from the previous version:
- Users:
- Plugin Developers:
- No changes required.
- Core Contributors:
- Refresh
node_modules
folder for updated developement dependencies.
- Refresh
Community Contributions
- #126: Add
eqls
alias foreql
. @RubenVerborgh - #127: Performance refactor for chainable methods. @RubenVerborgh
- #133: Assertion
.throw
support for primitives. @RubenVerborgh - #137: Assertion
.throw
support for empty messages. @timnew - #136: Fix backward negation messages when using
.above()
and.below()
. @whatthejeff
Thank you to all who took time to contribute!
Other Bug Fixes
- Improve type detection of
.a()
/.an()
to work in cross-browser scenarios. - #116:
.throw()
has cleaner display of errors when WebKit browsers. - #120:
.eql()
now works to compare dom nodes in browsers.
Usage Updates
For Users
1. Component Support: Chai now included the proper configuration to be installed as a component. Component users are encouraged to consult chaijs.com for the latest version number as using the master branch does not gaurantee stability.
// relevant component.json
devDependencies: {
"chaijs/chai": "1.5.0"
}
Alternatively, bleeding-edge is available:
$ component install chaijs/chai
2. Configurable showDiff: Some test runners (such as mocha) include support for showing the diff of strings and objects when an equality error occurs. Chai has already included support for this, however some users may not prefer this display behavior. To revert to no diff display, the following configuration is available:
chai.Assertion.showDiff = false; // diff output disabled
chai.Assertion.showDiff = true; // default, diff output enabled
For Plugin Developers
1. New Utility - type: The new utility .type()
is available as a better implementation of typeof
that can be used cross-browser. It handles the inconsistencies of Array, null
, and undefined
detection.
- @param {Mixed} object to detect type of
- @return {String} object type
chai.use(function (c, utils) {
// some examples
utils.type({}); // 'object'
utils.type(null); // `null'
utils.type(undefined); // `undefined`
utils.type([]); // `array`
});
For Core Contributors
1. Browser Testing: Browser testing of the ./chai.js
file is now available in the command line
via PhantomJS. make test
and Travis-CI will now also rebuild and test ./chai.js
. Consequently, all
pull requests will now be browser tested in this way.
Note: Contributors opening pull requests should still NOT include the browser build.
2. SauceLabs Testing: Early SauceLab support has been enabled with the file ./support/mocha-cloud.js
.
Those interested in trying it out should create a free Open Sauce account
and include their credentials in ./test/auth/sauce.json
.