OSDN Git Service

GeorgeValergas/embrr
[embrj/master.git] / test / bower_components / chai / ReleaseNotes.md
1 # Release Notes
2
3 ## 1.8.1 / 2013-10-10 
4
5 The following changes are required if you are upgrading from the previous version:
6
7 - **Users:**
8   - Refresh `node_modules` folder for updated dependencies. 
9 - **Plugin Developers:** 
10   - No changes required
11 - **Core Contributors:** 
12   - Refresh `node_modules` folder for updated dependencies. 
13
14 ### Browserify
15
16 This is a small patch that updates the dependency tree so browserify users can install
17 chai. (Remove conditional requires)
18
19 ## 1.8.0 / 2013-09-18 
20
21 The following changes are required if you are upgrading from the previous version:
22
23 - **Users:**
24   - See `deep.equal` notes.
25 - **Plugin Developers:** 
26   - No changes required
27 - **Core Contributors:** 
28   - Refresh `node_modules` folder for updated dependencies. 
29
30 ### Deep Equals
31
32 This version of Chai focused on a overhaul to the deep equal utility. The code for this
33 tool has been removed from the core lib and can now be found at: 
34 [chai / deep-eql](https://github.com/chaijs/deep-eql). As stated in previous releases,
35 this is part of a larger initiative to provide transparency, independent testing, and coverage for
36 some of the more complicated internal tools. 
37
38 For the most part `.deep.equal` will behave the same as it has. However, in order to provide a 
39 consistent ruleset across all types being tested, the following changes have been made and _might_
40 require changes to your tests.
41
42 **1.** Strict equality for non-traversable nodes according to [egal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
43
44 _Previously:_ Non-traversable equal via `===`.
45
46 ```js
47 expect(NaN).to.deep.equal(NaN);
48 expect(-0).to.not.deep.equal(+0);
49 ```
50
51 **2.** Arguments are not Arrays (and all types must be equal):
52
53 _Previously:_ Some crazy nonsense that led to empty arrays deep equaling empty objects deep equaling dates.
54
55 ```js
56 expect(arguments).to.not.deep.equal([]);
57 expect(Array.prototype.slice.call(arguments)).to.deep.equal([]);
58 ```
59
60 - [#156](https://github.com/chaijs/chai/issues/156) Empty object is eql to empty array
61 - [#192](https://github.com/chaijs/chai/issues/192) empty object is eql to a Date object
62 - [#194](https://github.com/chaijs/chai/issues/194) refactor deep-equal utility
63
64 ### CI and Browser Testing
65
66 Chai now runs the browser CI suite using [Karma](http://karma-runner.github.io/) directed at 
67 [SauceLabs](https://saucelabs.com/). This means we get to know where our browser support stands...
68 and we get a cool badge:
69
70 [![Selenium Test Status](https://saucelabs.com/browser-matrix/logicalparadox.svg)](https://saucelabs.com/u/logicalparadox)
71
72 Look for the list of browsers/versions to expand over the coming releases.
73
74 - [#195](https://github.com/chaijs/chai/issues/195) karma test framework
75
76 ## 1.7.2 / 2013-06-27 
77
78 The following changes are required if you are upgrading from the previous version:
79
80 - **Users:**
81   - No changes required.
82 - **Plugin Developers:** 
83   - No changes required
84 - **Core Contributors:** 
85   - Refresh `node_modules` folder for updated dependencies. 
86
87 ### Coverage Reporting
88
89 Coverage reporting has always been available for core-developers but the data has never been published
90 for our end users. In our ongoing effort to improve accountability this data will now be published via
91 the [coveralls.io](https://coveralls.io/) service. A badge has been added to the README and the full report
92 can be viewed online at the [chai coveralls project](https://coveralls.io/r/chaijs/chai). Furthermore, PRs 
93 will receive automated messages indicating how their PR impacts test coverage. This service is tied to TravisCI.
94
95 ### Other Fixes
96
97 - [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`. (Fix ignore all)
98
99 ## 1.7.1 / 2013-06-24 
100
101 The following changes are required if you are upgrading from the previous version:
102
103 - **Users:**
104   - No changes required.
105 - **Plugin Developers:** 
106   - No changes required
107 - **Core Contributors:** 
108   - Refresh `node_modules` folder for updated dependencies. 
109
110 ### Official Bower Support
111
112 Support has been added for the Bower Package Manager ([bower.io])(http://bower.io/). Though
113 Chai could be installed via Bower in the past, this update adds official support via the `bower.json`
114 specification file. 
115
116 - [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`.
117
118 ## 1.7.0 / 2013-06-17 
119
120 The following changes are required if you are upgrading from the previous version:
121
122 - **Users:**
123   - No changes required.
124 - **Plugin Developers:** 
125   - Review AssertionError update notice.
126 - **Core Contributors:** 
127   - Refresh `node_modules` folder for updated dependencies. 
128
129 ### AssertionError Update Notice
130
131 Chai now uses [chaijs/assertion-error](https://github.com/chaijs/assertion-error) instead an internal
132 constructor. This will allow for further iteration/experimentation of the AssertionError constructor 
133 independant of Chai. Future plans include stack parsing for callsite support. 
134
135 This update constructor has a different constructor param signature that conforms more with the standard
136 `Error` object. If your plugin throws and `AssertionError` directly you will need to update your plugin 
137 with the new signature.
138
139 ```js
140 var AssertionError = require('chai').AssertionError;
141
142 /**
143  * previous
144  *
145  * @param {Object} options
146  */
147
148 throw new AssertionError({
149     message: 'An assertion error occurred'
150   , actual: actual
151   , expect: expect
152   , startStackFunction: arguments.callee
153   , showStack: true
154 });
155
156 /**
157  * new
158  *
159  * @param {String} message
160  * @param {Object} options
161  * @param {Function} start stack function
162  */
163
164 throw new AssertionError('An assertion error occurred', {
165     actual: actual
166   , expect: expect
167   , showStack: true
168 }, arguments.callee);
169
170 // other signatures
171 throw new AssertionError('An assertion error occurred');
172 throw new AssertionError('An assertion error occurred', null, arguments.callee);
173 ```
174
175 #### External Dependencies
176
177 This is the first non-developement dependency for Chai. As Chai continues to evolve we will begin adding
178 more; the next will likely be improved type detection and deep equality. With Chai's userbase continually growing
179 there is an higher need for accountability and documentation. External dependencies will allow us to iterate and
180 test on features independent from our interfaces. 
181
182 Note: The browser packaged version `chai.js` will ALWAYS contain all dependencies needed to run Chai.
183
184 ### Community Contributions
185
186 - [#169](https://github.com/chaijs/chai/pull/169) Fix deep equal comparison for Date/Regexp types. [@katsgeorgeek](https://github.com/katsgeorgeek)
187 - [#171](https://github.com/chaijs/chai/pull/171) Add `assert.notOk()`. [@Bartvds](https://github.com/Bartvds)
188 - [#173](https://github.com/chaijs/chai/pull/173) Fix `inspect` utility. [@domenic](https://github.com/domenic)
189
190 Thank you to all who took the time to contribute!
191
192 ## 1.6.1 / 2013-06-05 
193
194 The following changes are required if you are upgrading from the previous version:
195
196 - **Users:**
197   - No changes required.
198 - **Plugin Developers:** 
199   - No changes required.
200 - **Core Contributors:** 
201   - Refresh `node_modules` folder for updated developement dependencies. 
202
203 ### Deep Equality
204
205 Regular Expressions are now tested as part of all deep equality assertions. In previous versions
206 they silently passed for all scenarios. Thanks to [@katsgeorgeek](https://github.com/katsgeorgeek) for the contribution.
207
208 ### Community Contributions
209
210 - [#161](https://github.com/chaijs/chai/pull/161) Fix documented name for assert interface's isDefined method. [@brandonpayton](https://github.com/brandonpayton)
211 - [#168](https://github.com/chaijs/chai/pull/168) Fix comparison equality of two regexps for when using deep equality. [@katsgeorgeek](https://github.com/katsgeorgeek)
212
213 Thank you to all who took the time to contribute!
214
215 ### Additional Notes
216
217 - Mocha has been locked at version `1.8.x` to ensure `mocha-phantomjs` compatibility.
218
219 ## 1.6.0 / 2013-04-29 
220
221 The following changes are required if you are upgrading from the previous version:
222
223 - **Users:**
224   - No changes required.
225 - **Plugin Developers:** 
226   - No changes required.
227 - **Core Contributors:** 
228   - Refresh `node_modules` folder for updated developement dependencies. 
229
230 ### New Assertions
231
232 #### Array Members Inclusion
233
234 Asserts that the target is a superset of `set`, or that the target and `set` have the same members.
235 Order is not taken into account. Thanks to [@NickHeiner](https://github.com/NickHeiner) for the contribution.
236
237 ```js
238 // (expect/should) full set
239 expect([4, 2]).to.have.members([2, 4]);
240 expect([5, 2]).to.not.have.members([5, 2, 1]);
241
242 // (expect/should) inclusion
243 expect([1, 2, 3]).to.include.members([3, 2]);
244 expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
245
246 // (assert) full set
247 assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
248
249 // (assert) inclusion 
250 assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
251
252 ```
253
254 #### Non-inclusion for Assert Interface
255
256 Most `assert` functions have a negative version, like `instanceOf()` has a corresponding `notInstaceOf()`. 
257 However `include()` did not have a corresponding `notInclude()`. This has been added.
258
259 ```js
260 assert.notInclude([ 1, 2, 3 ], 8);
261 assert.notInclude('foobar', 'baz');
262 ```
263
264 ### Community Contributions
265
266 - [#140](https://github.com/chaijs/chai/pull/140) Restore `call`/`apply` methods for plugin interface. [@RubenVerborgh](https://github.com/RubenVerborgh)
267 - [#148](https://github.com/chaijs/chai/issues/148)/[#153](https://github.com/chaijs/chai/pull/153) Add `members` and `include.members` assertions. [#NickHeiner](https://github.com/NickHeiner)
268
269 Thank you to all who took time to contribute!
270
271 ### Other Bug Fixes
272
273 - [#142](https://github.com/chaijs/chai/issues/142) `assert#include` will no longer silently pass on wrong-type haystack.
274 - [#158](https://github.com/chaijs/chai/issues/158) `assert#notInclude` has been added.
275 - Travis-CI now tests Node.js `v0.10.x`. Support for `v0.6.x` has been removed. `v0.8.x` is still tested as before.
276
277 ## 1.5.0 / 2013-02-03 
278
279 ### Migration Requirements
280
281 The following changes are required if you are upgrading from the previous version:
282
283 - **Users:** 
284   - _Update [2013-02-04]:_ Some users may notice a small subset of deep equality assertions will no longer pass. This is the result of 
285   [#120](https://github.com/chaijs/chai/issues/120), an improvement to our deep equality algorithm. Users will need to revise their assertions
286   to be more granular should this occur. Further information: [#139](https://github.com/chaijs/chai/issues/139).
287 - **Plugin Developers:** 
288   - No changes required.
289 - **Core Contributors:** 
290   - Refresh `node_modules` folder for updated developement dependencies.
291
292 ### Community Contributions
293
294 - [#126](https://github.com/chaijs/chai/pull/126): Add `eqls` alias for `eql`. [@RubenVerborgh](https://github.com/RubenVerborgh)
295 - [#127](https://github.com/chaijs/chai/issues/127): Performance refactor for chainable methods. [@RubenVerborgh](https://github.com/RubenVerborgh)
296 - [#133](https://github.com/chaijs/chai/pull/133): Assertion `.throw` support for primitives. [@RubenVerborgh](https://github.com/RubenVerborgh)
297 - [#137](https://github.com/chaijs/chai/issues/137): Assertion `.throw` support for empty messages. [@timnew](https://github.com/timnew)
298 - [#136](https://github.com/chaijs/chai/pull/136): Fix backward negation messages when using `.above()` and `.below()`. [@whatthejeff](https://github.com/whatthejeff)
299
300 Thank you to all who took time to contribute!
301
302 ### Other Bug Fixes
303
304 - Improve type detection of `.a()`/`.an()` to work in cross-browser scenarios.
305 - [#116](https://github.com/chaijs/chai/issues/116): `.throw()` has cleaner display of errors when WebKit browsers.
306 - [#120](https://github.com/chaijs/chai/issues/120): `.eql()` now works to compare dom nodes in browsers.
307
308
309 ### Usage Updates
310
311 #### For Users
312
313 **1. Component Support:** Chai now included the proper configuration to be installed as a 
314 [component](https://github.com/component/component). Component users are encouraged to consult
315 [chaijs.com](http://chaijs.com) for the latest version number as using the master branch
316 does not gaurantee stability. 
317
318 ```js
319 // relevant component.json
320   devDependencies: {
321     "chaijs/chai": "1.5.0"
322   }
323 ```
324
325 Alternatively, bleeding-edge is available:
326
327     $ component install chaijs/chai
328
329 **2. Configurable showDiff:** Some test runners (such as [mocha](http://visionmedia.github.com/mocha/)) 
330 include support for showing the diff of strings and objects when an equality error occurs. Chai has 
331 already included support for this, however some users may not prefer this display behavior. To revert to 
332 no diff display, the following configuration is available:
333
334 ```js
335 chai.Assertion.showDiff = false; // diff output disabled
336 chai.Assertion.showDiff = true; // default, diff output enabled
337 ```
338
339 #### For Plugin Developers
340
341 **1. New Utility - type**: The new utility `.type()` is available as a better implementation of `typeof` 
342 that can be used cross-browser. It handles the inconsistencies of Array, `null`, and `undefined` detection.
343
344 - **@param** _{Mixed}_ object to detect type of
345 - **@return** _{String}_ object type
346
347 ```js
348 chai.use(function (c, utils) {
349   // some examples
350   utils.type({}); // 'object'
351   utils.type(null); // `null'
352   utils.type(undefined); // `undefined`
353   utils.type([]); // `array`
354 });
355 ```
356
357 #### For Core Contributors
358
359 **1. Browser Testing**: Browser testing of the `./chai.js` file is now available in the command line 
360 via PhantomJS. `make test` and Travis-CI will now also rebuild and test `./chai.js`. Consequently, all 
361 pull requests will now be browser tested in this way. 
362
363 _Note: Contributors opening pull requests should still NOT include the browser build._
364
365 **2. SauceLabs Testing**: Early SauceLab support has been enabled with the file `./support/mocha-cloud.js`.
366 Those interested in trying it out should create a free [Open Sauce](https://saucelabs.com/signup/plan) account
367 and include their credentials in `./test/auth/sauce.json`.