mirror of
https://github.com/chaijs/chai
synced 2024-11-14 15:57:10 +00:00
Release 1.10.0
This commit is contained in:
parent
828f48148f
commit
c8b3208ce4
8 changed files with 378 additions and 278 deletions
20
History.md
20
History.md
|
@ -1,4 +1,24 @@
|
|||
|
||||
1.10.0 / 2014-11-10
|
||||
==================
|
||||
|
||||
* Merge pull request #297 from prodatakey/noopchainfunc
|
||||
* Merge pull request #300 from julienw/299-fix-getMessage-test
|
||||
* Fix #299: the test is defining global variables
|
||||
* Add a couple more unit tests
|
||||
* Add unit tests for chained terminating property asserts
|
||||
* Revise documentation wording
|
||||
* Add docs for function style NOOP asserts
|
||||
* Make the NOOP function a shared constant
|
||||
* Merge pull request #298 from dasilvacontin/negativeZeroLogging
|
||||
* why not more assertions
|
||||
* added test for inspecting `-0`
|
||||
* a more readable/simple condition statement, as pointed out by @keithamus
|
||||
* added check for logging negative zero
|
||||
* Change test to not trigger argument bug
|
||||
* Allows writing lint-friendly tests
|
||||
* readme: update contributors for 1.9.2
|
||||
|
||||
1.9.2 / 2014-09-29
|
||||
==================
|
||||
|
||||
|
|
16
README.md
16
README.md
|
@ -24,20 +24,22 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|||
|
||||
### Contributors
|
||||
|
||||
repo age : 2 years, 10 months
|
||||
active : 181 days
|
||||
commits : 776
|
||||
repo age : 2 years, 11 months
|
||||
active : 189 days
|
||||
commits : 792
|
||||
files : 57
|
||||
authors :
|
||||
550 Jake Luer 70.9%
|
||||
79 Veselin Todorov 10.2%
|
||||
43 Domenic Denicola 5.5%
|
||||
551 Jake Luer 69.6%
|
||||
79 Veselin Todorov 10.0%
|
||||
43 Domenic Denicola 5.4%
|
||||
7 Joshua Perry 0.9%
|
||||
6 Ruben Verborgh 0.8%
|
||||
5 George Kats 0.6%
|
||||
5 Jo Liss 0.6%
|
||||
5 Juliusz Gonera 0.6%
|
||||
5 Scott Nonnenberg 0.6%
|
||||
5 leider 0.6%
|
||||
4 David da Silva 0.5%
|
||||
4 John Firebaugh 0.5%
|
||||
4 Max Edmands 0.5%
|
||||
4 Nick Heiner 0.5%
|
||||
|
@ -48,6 +50,7 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|||
3 Duncan Beevers 0.4%
|
||||
3 Jake Rosoman 0.4%
|
||||
3 Jeff Barczewski 0.4%
|
||||
3 Keith Cirkel 0.4%
|
||||
3 Ryunosuke SATO 0.4%
|
||||
2 Bartvds 0.3%
|
||||
2 Edwin Shao 0.3%
|
||||
|
@ -64,6 +67,7 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|||
1 DD 0.1%
|
||||
1 Dido Arellano 0.1%
|
||||
1 Jeff Welch 0.1%
|
||||
1 Julien Wajsberg 0.1%
|
||||
1 Kilian Ciuffolo 0.1%
|
||||
1 Luís Cardoso 0.1%
|
||||
1 Martin Middel 0.1%
|
||||
|
|
|
@ -1,5 +1,85 @@
|
|||
# Release Notes
|
||||
|
||||
## 1.10.0 / 2014-11-10
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required
|
||||
- **Plugin Developers:**
|
||||
- Review `addChainableNoop` notes below.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Noop Function for Terminating Assertion Properties
|
||||
|
||||
The following assertions can now also be used in the function-call form:
|
||||
|
||||
* ok
|
||||
* true
|
||||
* false
|
||||
* null
|
||||
* undefined
|
||||
* exist
|
||||
* empty
|
||||
* arguments
|
||||
* Arguments
|
||||
|
||||
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.
|
||||
|
||||
```js
|
||||
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.
|
||||
|
||||
```js
|
||||
expect(true).to.be.true();
|
||||
foo.should.be.ok();
|
||||
```
|
||||
|
||||
These forms can also be mixed in any way, these are all functionally identical:
|
||||
|
||||
```js
|
||||
expect(true).to.be.true.and.not.false();
|
||||
expect(true).to.be.true().and.not.false;
|
||||
expect(true).to.be.true.and.not.false;
|
||||
```
|
||||
|
||||
#### Plugin Authors
|
||||
|
||||
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.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#297](https://github.com/chaijs/chai/pull/297) Allow writing lint-friendly tests. [@joshperry](https://github.com/joshperry)
|
||||
- [#298](https://github.com/chaijs/chai/pull/298) Add check for logging `-0`. [@dasilvacontin](https://github.com/dasilvacontin)
|
||||
- [#300](https://github.com/chaijs/chai/pull/300) Fix #299: the test is defining global variables [@julienw](https://github.com/julienw)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
## 1.9.2 / 2014-09-29
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chai"
|
||||
, "version": "1.9.2"
|
||||
, "version": "1.10.0"
|
||||
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
|
||||
, "license": "MIT"
|
||||
, "keywords": [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "chai"
|
||||
, "repo": "chaijs/chai"
|
||||
, "version": "1.9.2"
|
||||
, "version": "1.10.0"
|
||||
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
|
||||
, "license": "MIT"
|
||||
, "keywords": [
|
||||
|
|
|
@ -11,7 +11,7 @@ var used = []
|
|||
* Chai version
|
||||
*/
|
||||
|
||||
exports.version = '1.9.2';
|
||||
exports.version = '1.10.0';
|
||||
|
||||
/*!
|
||||
* Assertion Error
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"Veselin Todorov <hi@vesln.com>",
|
||||
"John Firebaugh <john.firebaugh@gmail.com>"
|
||||
],
|
||||
"version": "1.9.2",
|
||||
"version": "1.10.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chaijs/chai"
|
||||
|
|
Loading…
Reference in a new issue