Skip to content

Commit

Permalink
Release 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Nov 10, 2014
1 parent 828f481 commit c8b3208
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 268 deletions.
20 changes: 20 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -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
==================

Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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%
Expand All @@ -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%
Expand Down
80 changes: 80 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Loading

0 comments on commit c8b3208

Please sign in to comment.