Releases: chaijs/chai
3.3.0 / 2015-09-08
This release adds some new assertions and fixes some quite important, long standing bugs. Here are the cliff notes:
- Bugfix: Property assertions that fail now show a stack trace!
- Bugfix: If you've used the
frozen,sealedorextensibleassertions to test primitives (e.g.expect(1).to.be.frozen), you may have noticed that in older browsers (ES5) these fail, and in new ones (ES6) they pass. They have now been fixed to consistently pass - The
assertinterface has been given the following new methods, to align better with other interfaces:,assert.isAtMost,assert.isAtLeast,assert.isNotTrue,assert.isNotFalse.
Community Contributions
Code Features & Fixes
- #494 Add
assert.isNotTrueandassert.isNotFalse.
By @cezarykluczynski - #496
frozen/extensible/sealedassertions behave the same in ES6 and ES5 environments.
By @astorije - #499 Simplify the
.emptyassertion.
By @Daveloper87 - #500 Add
assert.isAtMostandassert.isAtLeast.
By @wraithan - #512 fixed expect('').to.contain('') so it passes. By @dereke
- #514 Fix stack trace tracking for property assertions.
By @kpdecker
Documentation fixes
- #495 Correct misplaced docs for assertions (
isBelow,isAbove,isTrue).
By @cezarykluczynski
3.2.0 / 2015-07-19
This release fixes a bug with the previous additions in 3.1.0. assert.frozen/expect().to.be.frozen/.should.be.frozen all accidentally called Object.isSealed() instead. Now they correctly call Object.isFrozen().
If you're using these features, please upgrade immediately.
It also adds aliases for a lot of assert methods:
- expect/should..respondTo: respondsTo
- expect/should..satisfy: satisfies
- assert.ok: assert.isOk
- assert.notOk: assert.isNotOk
- assert.extensible: assert.isExtensible
- assert.notExtensible: assert.isNotExtensible
- assert.sealed: assert.isSealed
- assert.notSealed: assert.isNotSealed
- assert.frozen: assert.isFrozen
- assert.notFrozen: assert.isNotFrozen
Community Contributions
Code Features & Fixes
- #482 Re-encrypt travis API key
By @keithamus - #482 Add respondsTo and satisfies as aliases
By @couchand - #485 Fixing a typo in the
getProperties()utility
By @jluchiji - #486 Added links to contribution guidelines to README
By @jluchiji - #489 Various work on aliases
By @astorije - #490 Fix wrong call to the underlying method when checking if an object is frozen
By @astorije
3.1.0 / 2015-07-16
This release adds assertions for extensibility/freezing/sealing on objects:
assert.extensible({});
assert.notExtensible(Object.preventExtensions({}));
expect(Object.preventExtensions({})).to.not.be.extensible;
Object.preventExtensions({}).should.not.be.extensible;
assert.notSealed({});
assert.sealed(Object.seal({}));
expect(Object.seal({})).to.be.sealed;
Object.seal({}).should.be.sealed;
assert.notFrozen({});
assert.frozen(Object.freeze({}));
expect(Object.freeze({})).to.be.frozen;
Object.freeze({}).should.be.frozen;It also adds assertions for checking if a number is NaN:
assert.isNaN(NaN);
assert.isNotNaN(5);
expect(NaN).to.be.NaN;
expect(5).to.not.be.NaN;
NaN.should.be.NaN;
5.should.not.be.NaN;Community Contributions
Code Features & Fixes
- #480 Added tests and expectations for NaN
By @bradcypert - #479 Assertions to test if objects are extensible/sealed/frozen.
By @matthewlucock - #468 Remove moot
versionproperty from bower.json.
By @kkirsche
3.0.0 / 2015-06-04
This release contains some small breaking changes. Most people are unlikely to
notice them - but here are the breaking changes:
- Switched from "Component" builds to "Browserify" builds for Browsers. If
you're using RequireJS with Chai, you might notice a change (chai used to
be a global, now it won't be - instead you'll have torequireit). .has.property('foo', undefined)will now specifically test to make sure
that the value'foo'is actually undefined - before it simply tested that
the key existed (but could have a value)..to.be.a('type')has changed to support more types, including ES6 types
such as'promise','symbol','float32array'etc, this also means using
ES6'sSymbol.toStringTagaffects the behaviour.to.be.a(). In addition to
this, Errors have the type of'error'.assert.ifError()now follows Node'sassert.ifError()behaviour - in other
words, if the first argument is truthy, it'll throw it.- ReleaseNotes.md is no longer maintained, see the Github Releases Page instead.
- History.md is no longer maintained, see the Github Commit Log instead.
Community Contributions
Code Features & Fixes
- #403
assert.ifError()behaves like Node.js: it throws if the first argument is present.
By @cjqed - #419 assertion-error bumped to
^1.0.1
By @keithamus (special thanks to @simonzack for his work on assertion-error) - #421 replace type.js with type-detect module.
By @Charminbear - #439 Add
.matches()as alias for.match().
By @thejameskyle - #451 Switch to using Browserify for the build system.
By @csnover - #452
.property('foo', undefined)now actually checks to see ifobj.foo === undefined(before it did not).
By @onefifth - #460 Automate release process as much as possible
By @keithamus
Documentation fixes
- #397 Improve docs for
.assert()
By @astorije - #401 Add some badges to the Readme.
By @keithamus - #424 Fix typo in docs for
.keys()
By @astorije - #429 Deprecate
.length(n)from the docs - use.lengthOf(n)instead.
By @valscion - #444 Change
.length(n)examples to.lengthOf(n)instead.
By @keithamus - #458 Remove stray character in
assert.notIncludedocs
By @BinaryMuse
2.3.0 / 2015-04-26
Added ownPropertyDescriptor assertion:
expect('test').to.have.ownPropertyDescriptor('length');
expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 });
expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 });
expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false);
expect('test').ownPropertyDescriptor('length').to.have.keys('value');Community Contributions
Code Features & Fixes
- #408 Add
ownPropertyDescriptor
assertion.
By @ljharb - #422 Improve ownPropertyDescriptor
tests.
By @ljharb
Documentation fixes
2.2.0 / 2015-03-26
Deep property strings can now be escaped using \\ - for example:
var deepCss = { '.link': { '[target]': 42 }};
expect(deepCss).to.have.deep.property('\\.link.\\[target\\]', 42)Community Contributions
Code Features & Fixes
Documentation fixes
- #405 Tweak documentation around
deep property escaping.
By @keithamus
2.1.2 / 2015-03-15
2.1.1 / 2015-03-04
Two minor bugfixes. No new features.
Community Contributions
Code Features & Fixes
- #385 Fix a bug (also described in
#387) wheredeep.propertywould not work with single
key names. By @eldritch-fossicker - #379 Fix bug where tools which overwrite
primitive prototypes, such as Babel or core-js would fail.
By @dcneiner
Documentation fixes
2.1.0 / 2015-02-23
Small release; fixes an issue where the Chai lib was incorrectly reporting the
version number.
Adds new should.fail() and expect.fail() methods, which are convenience
methods to throw Assertion Errors.
Community Contributions
Code Features & Fixes
2.0.0 / 2015-02-09
Unfortunately with 1.10.0 - compatibility broke with older versions because of
the addChainableNoop. This change has been reverted.
Any plugins using addChainableNoop should cease to do so.
Any developers wishing for this behaviour can use dirty-chai
by @joshperry
Community Contributions
Code Features & Fixes
- #361
.keys()now accepts Objects, extracting keys from them. By @gregglind - #359
.keys()no longer mutates passed arrays. By @gregglind - #349 Add a new chainable keyword -
.which. By @toastynerd - #333 Add
.change,.increaseand.decreaseassertions. By @cmpolis - #335
chai.utilis now exposed @DingoEatingFuzz - #328 Add
.includesand.containsaliases (for.includeand.contain). By @lo1tuma - #313 Add
.any.keys()and.all.keys()qualifiers. By @cjqed - #312 Add
assert.sameDeepMembers(). By @cjqed - #311 Add
assert.isAbove()andassert.isBelow(). By @cjqed - #308
propertyanddeep.propertynow pass if a value is set toundefined. By @prodatakey - #309 optimize deep equal in Arrays. By @ericdouglas
- #306 revert #297 - allowing lint-friendly tests. By @keithamus
Documentation fixes
- #357 Copyright year updated in docs. By @danilovaz
- #325 Fix documentation for overwriteChainableMethod. By @chasenlehara
- #334 Typo fix. By @hurrymaplelad
- #317 Typo fix. By @jasonkarns
- #318 Typo fix. By @jasonkarns
- #316 Typo fix. By @jasonkarns