💾 Archived View for gmi.noulin.net › gitRepositories › git-off › file › node_modules › chai › Releas… captured on 2023-07-10 at 15:57:00. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
ReleaseNotes.md (30024B)
1 # Release Notes 2 3 ## Note 4 5 As of 3.0.0, the ReleaseNotes.md file has been deprecated. [Please refer to the release notes available on Github](https://github.com/chaijs/chai/releases). Or 6 [the release notes on the chaijs.com website](https://chaijs.com/releases). 7 8 --- 9 10 ## 2.3.0 / 2015-04-26 11 12 Added `ownPropertyDescriptor` assertion: 13 14 ```js 15 expect('test').to.have.ownPropertyDescriptor('length'); 16 expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); 17 expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); 18 expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false); 19 expect('test').ownPropertyDescriptor('length').to.have.keys('value'); 20 ``` 21 22 ### Community Contributions 23 24 #### Code Features & Fixes 25 26 * [#408](https://github.com/chaijs/chai/pull/408) Add `ownPropertyDescriptor` 27 assertion. 28 By [@ljharb](https://github.com/ljharb) 29 * [#422](https://github.com/chaijs/chai/pull/422) Improve ownPropertyDescriptor 30 tests. 31 By [@ljharb](https://github.com/ljharb) 32 33 #### Documentation fixes 34 35 * [#417](https://github.com/chaijs/chai/pull/417) Fix documentation typo 36 By [@astorije](https://github.com/astorije) 37 * [#423](https://github.com/chaijs/chai/pull/423) Fix inconsistency in docs. 38 By [@ehntoo](https://github.com/ehntoo) 39 40 41 ## 2.2.0 / 2015-03-26 42 43 Deep property strings can now be escaped using `\\` - for example: 44 45 ```js 46 var deepCss = { '.link': { '[target]': 42 }}; 47 expect(deepCss).to.have.deep.property('\\.link.\\[target\\]', 42) 48 ``` 49 50 ### Community Contributions 51 52 #### Code Features & Fixes 53 54 * [#402](https://github.com/chaijs/chai/pull/402) Allow escaping of deep 55 property keys. 56 By [@umireon](https://github.com/umireon) 57 58 #### Documentation fixes 59 60 * [#405](https://github.com/chaijs/chai/pull/405) Tweak documentation around 61 deep property escaping. 62 By [@keithamus](https://github.com/keithamus) 63 64 65 ## 2.1.2 / 2015-03-15 66 67 A minor bug fix. No new features. 68 69 ### Community Contributions 70 71 #### Code Features & Fixes 72 73 * [#395](https://github.com/chaijs/chai/pull/395) Fix eval-related bugs with 74 assert.operator ([#386](https://github.com/chaijs/chai/pull/386)). 75 By [@cjqed](https://github.com/cjqed) 76 77 ## 2.1.1 / 2015-03-04 78 79 Two minor bugfixes. No new features. 80 81 ### Community Contributions 82 83 #### Code Features & Fixes 84 85 * [#385](https://github.com/chaijs/chai/pull/385) Fix a bug (also described in 86 [#387](https://github.com/chaijs/chai/pull/385)) where `deep.property` would not work with single 87 key names. By [@eldritch-fossicker](https://github.com/eldritch-fossicker) 88 * [#379](https://github.com/chaijs/chai/pull/379) Fix bug where tools which overwrite 89 primitive prototypes, such as Babel or core-js would fail. 90 By [@dcneiner](https://github.com/dcneiner) 91 92 #### Documentation fixes 93 94 * [#382](https://github.com/chaijs/chai/pull/382) Add doc for showDiff argument in assert. 95 By [@astorije](https://github.com/astorije) 96 * [#383](https://github.com/chaijs/chai/pull/383) Improve wording for truncateTreshold docs 97 By [@gurdiga](https://github.com/gurdiga) 98 * [#381](https://github.com/chaijs/chai/pull/381) Improve wording for assert.empty docs 99 By [@astorije](https://github.com/astorije) 100 101 ## 2.1.0 / 2015-02-23 102 103 Small release; fixes an issue where the Chai lib was incorrectly reporting the 104 version number. 105 106 Adds new `should.fail()` and `expect.fail()` methods, which are convinience 107 methods to throw Assertion Errors. 108 109 ### Community Contributions 110 111 #### Code Features & Fixes 112 113 * [#356](https://github.com/chaijs/chai/pull/356) Add should.fail(), expect.fail(). By [@Soviut](https://github.com/Soviut) 114 * [#374](https://github.com/chaijs/chai/pull/374) Increment version. By [@jmm](https://github.com/jmm) 115 116 ## 2.0.0 / 2015-02-09 117 118 Unfortunately with 1.10.0 - compatibility broke with older versions because of 119 the `addChainableNoop`. This change has been reverted. 120 121 Any plugins using `addChainableNoop` should cease to do so. 122 123 Any developers wishing for this behaviour can use [dirty-chai](https://www.npmjs.com/package/dirty-chai) 124 by [@joshperry](https://github.com/joshperry) 125 126 ### Community Contributions 127 128 #### Code Features & Fixes 129 130 * [#361](https://github.com/chaijs/chai/pull/361) `.keys()` now accepts Objects, extracting keys from them. By [@gregglind](https://github.com/gregglind) 131 * [#359](https://github.com/chaijs/chai/pull/359) `.keys()` no longer mutates passed arrays. By [@gregglind](https://github.com/gregglind) 132 * [#349](https://github.com/chaijs/chai/pull/349) Add a new chainable keyword - `.which`. By [@toastynerd](https://github.com/toastynerd) 133 * [#333](https://github.com/chaijs/chai/pull/333) Add `.change`, `.increase` and `.decrease` assertions. By [@cmpolis](https://github.com/cmpolis) 134 * [#335](https://github.com/chaijs/chai/pull/335) `chai.util` is now exposed [@DingoEatingFuzz](https://github.com/DingoEatingFuzz) 135 * [#328](https://github.com/chaijs/chai/pull/328) Add `.includes` and `.contains` aliases (for `.include` and `.contain`). By [@lo1tuma](https://github.com/lo1tuma) 136 * [#313](https://github.com/chaijs/chai/pull/313) Add `.any.keys()` and `.all.keys()` qualifiers. By [@cjqed](https://github.com/cjqed) 137 * [#312](https://github.com/chaijs/chai/pull/312) Add `assert.sameDeepMembers()`. By [@cjqed](https://github.com/cjqed) 138 * [#311](https://github.com/chaijs/chai/pull/311) Add `assert.isAbove()` and `assert.isBelow()`. By [@cjqed](https://github.com/cjqed) 139 * [#308](https://github.com/chaijs/chai/pull/308) `property` and `deep.property` now pass if a value is set to `undefined`. By [@prodatakey](https://github.com/prodatakey) 140 * [#309](https://github.com/chaijs/chai/pull/309) optimize deep equal in Arrays. By [@ericdouglas](https://github.com/ericdouglas) 141 * [#306](https://github.com/chaijs/chai/pull/306) revert #297 - allowing lint-friendly tests. By [@keithamus](https://github.com/keithamus) 142 143 #### Documentation fixes 144 145 * [#357](https://github.com/chaijs/chai/pull/357) Copyright year updated in docs. By [@danilovaz](https://github.com/danilovaz) 146 * [#325](https://github.com/chaijs/chai/pull/325) Fix documentation for overwriteChainableMethod. By [@chasenlehara](https://github.com/chasenlehara) 147 * [#334](https://github.com/chaijs/chai/pull/334) Typo fix. By [@hurrymaplelad](https://github.com/hurrymaplelad) 148 * [#317](https://github.com/chaijs/chai/pull/317) Typo fix. By [@jasonkarns](https://github.com/jasonkarns) 149 * [#318](https://github.com/chaijs/chai/pull/318) Typo fix. By [@jasonkarns](https://github.com/jasonkarns) 150 * [#316](https://github.com/chaijs/chai/pull/316) Typo fix. By [@jasonkarns](https://github.com/jasonkarns) 151 152 153 ## 1.10.0 / 2014-11-10 154 155 The following changes are required if you are upgrading from the previous version: 156 157 - **Users:** 158 - No changes required 159 - **Plugin Developers:** 160 - Review `addChainableNoop` notes below. 161 - **Core Contributors:** 162 - Refresh `node_modules` folder for updated dependencies. 163 164 ### Noop Function for Terminating Assertion Properties 165 166 The following assertions can now also be used in the function-call form: 167 168 * ok 169 * true 170 * false 171 * null 172 * undefined 173 * exist 174 * empty 175 * arguments 176 * Arguments 177 178 The above list of assertions are property getters that assert immediately on 179 access. Because of that, they were written to be used by terminating the assertion 180 chain with a property access. 181 182 ```js 183 expect(true).to.be.true; 184 foo.should.be.ok; 185 ``` 186 187 This syntax is definitely aesthetically pleasing but, if you are linting your 188 test code, your linter will complain with an error something like "Expected an 189 assignment or function call and instead saw an expression." Since the linter 190 doesn't know about the property getter it assumes this line has no side-effects, 191 and throws a warning in case you made a mistake. 192 193 Squelching these errors is not a good solution as test code is getting to be 194 just as important as, if not more than, production code. Catching syntactical 195 errors in tests using static analysis is a great tool to help make sure that your 196 tests are well-defined and free of typos. 197 198 A better option was to provide a function-call form for these assertions so that 199 the code's intent is more clear and the linters stop complaining about something 200 looking off. This form is added in addition to the existing property access form 201 and does not impact existing test code. 202 203 ```js 204 expect(true).to.be.true(); 205 foo.should.be.ok(); 206 ``` 207 208 These forms can also be mixed in any way, these are all functionally identical: 209 210 ```js 211 expect(true).to.be.true.and.not.false(); 212 expect(true).to.be.true().and.not.false; 213 expect(true).to.be.true.and.not.false; 214 ``` 215 216 #### Plugin Authors 217 218 If you would like to provide this function-call form for your terminating assertion 219 properties, there is a new function to register these types of asserts. Instead 220 of using `addProperty` to register terminating assertions, simply use `addChainableNoop` 221 instead; the arguments to both are identical. The latter will make the assertion 222 available in both the attribute and function-call forms and should have no impact 223 on existing users of your plugin. 224 225 ### Community Contributions 226 227 - [#297](https://github.com/chaijs/chai/pull/297) Allow writing lint-friendly tests. [@joshperry](https://github.com/joshperry) 228 - [#298](https://github.com/chaijs/chai/pull/298) Add check for logging `-0`. [@dasilvacontin](https://github.com/dasilvacontin) 229 - [#300](https://github.com/chaijs/chai/pull/300) Fix #299: the test is defining global variables [@julienw](https://github.com/julienw) 230 231 Thank you to all who took time to contribute! 232 233 ## 1.9.2 / 2014-09-29 234 235 The following changes are required if you are upgrading from the previous version: 236 237 - **Users:** 238 - No changes required 239 - **Plugin Developers:** 240 - No changes required 241 - **Core Contributors:** 242 - Refresh `node_modules` folder for updated dependencies. 243 244 ### Community Contributions 245 246 - [#264](https://github.com/chaijs/chai/pull/264) Show diff for keys assertions [@cjthompson](https://github.com/cjthompson) 247 - [#267](https://github.com/chaijs/chai/pull/267) Use SVG badges [@shinnn](https://github.com/shinnn) 248 - [#268](https://github.com/chaijs/chai/pull/268) Allow messages to be functions (sinon-compat) [@charlierudolph](https://github.com/charlierudolph) 249 - [#269](https://github.com/chaijs/chai/pull/269) Remove unused argument for #lengthOf [@charlierudolph](https://github.com/charlierudolph) 250 - [#275](https://github.com/chaijs/chai/pull/275) Rewrite pretty-printing HTML elements to prevent throwing internal errors [@DrRataplan](https://github.com/DrRataplan) 251 - [#277](https://github.com/chaijs/chai/pull/277) Fix assert documentation for #sameMembers [@charlierudolph](https://github.com/charlierudolph) 252 - [#279](https://github.com/chaijs/chai/pull/279) closeTo should check value's type before assertion [@mohayonao](https://github.com/mohayonao) 253 - [#289](https://github.com/chaijs/chai/pull/289) satisfy is called twice [@charlierudolph](https://github.com/charlierudolph) 254 - [#292](https://github.com/chaijs/chai/pull/292) resolve conflicts with node-webkit and global usage [@boneskull](https://github.com/boneskull) 255 256 Thank you to all who took time to contribute! 257 258 ## 1.9.1 / 2014-03-19 259 260 The following changes are required if you are upgrading from the previous version: 261 262 - **Users:** 263 - Migrate configuration options to new interface. (see notes) 264 - **Plugin Developers:** 265 - No changes required 266 - **Core Contributors:** 267 - Refresh `node_modules` folder for updated dependencies. 268 269 ### Configuration 270 271 There have been requests for changes and additions to the configuration mechanisms 272 and their impact in the Chai architecture. As such, we have decoupled the 273 configuration from the `Assertion` constructor. This not only allows for centralized 274 configuration, but will allow us to shift the responsibility from the `Assertion` 275 constructor to the `assert` interface in future releases. 276 277 These changes have been implemented in a non-breaking way, but a depretiation 278 warning will be presented to users until they migrate. The old config method will 279 be removed in either `v1.11.0` or `v2.0.0`, whichever comes first. 280 281 #### Quick Migration 282 283 ```js 284 // change this: 285 chai.Assertion.includeStack = true; 286 chai.Assertion.showDiff = false; 287 288 // ... to this: 289 chai.config.includeStack = true; 290 chai.config.showDiff = false; 291 ``` 292 293 #### All Config Options 294 295 ##### config.includeStack 296 297 - **@param** _{Boolean}_ 298 - **@default** `false` 299 300 User configurable property, influences whether stack trace is included in 301 Assertion error message. Default of `false` suppresses stack trace in the error 302 message. 303 304 ##### config.showDiff 305 306 - **@param** _{Boolean}_ 307 - **@default** `true` 308 309 User configurable property, influences whether or not the `showDiff` flag 310 should be included in the thrown AssertionErrors. `false` will always be `false`; 311 `true` will be true when the assertion has requested a diff be shown. 312 313 ##### config.truncateThreshold **(NEW)** 314 315 - **@param** _{Number}_ 316 - **@default** `40` 317 318 User configurable property, sets length threshold for actual and expected values 319 in assertion errors. If this threshold is exceeded, the value is truncated. 320 321 Set it to zero if you want to disable truncating altogether. 322 323 ```js 324 chai.config.truncateThreshold = 0; // disable truncating 325 ``` 326 327 ### Community Contributions 328 329 - [#228](https://github.com/chaijs/chai/pull/228) Deep equality check for memebers. [@duncanbeevers](https://github.com/duncanbeevers) 330 - [#247](https://github.com/chaijs/chai/pull/247) Proofreading. [@didorellano](https://github.com/didoarellano) 331 - [#244](https://github.com/chaijs/chai/pull/244) Fix `contain`/`include` 1.9.0 regression. [@leider](https://github.com/leider) 332 - [#233](https://github.com/chaijs/chai/pull/233) Improvements to `ssfi` for `assert` interface. [@refack](https://github.com/refack) 333 - [#251](https://github.com/chaijs/chai/pull/251) New config option: object display threshold. [@romario333](https://github.com/romario333) 334 335 Thank you to all who took time to contribute! 336 337 ### Other Bug Fixes 338 339 - [#183](https://github.com/chaijs/chai/issues/183) Allow `undefined` for actual. (internal api) 340 - Update Karam(+plugins)/Istanbul to most recent versions. 341 342 ## 1.9.0 / 2014-01-29 343 344 The following changes are required if you are upgrading from the previous version: 345 346 - **Users:** 347 - No changes required 348 - **Plugin Developers:** 349 - Review [#219](https://github.com/chaijs/chai/pull/219). 350 - **Core Contributors:** 351 - Refresh `node_modules` folder for updated dependencies. 352 353 ### Community Contributions 354 355 - [#202](https://github.com/chaijs/chai/pull/201) Improve error message for .throw(). [@andreineculau](https://github.com/andreineculau) 356 - [#217](https://github.com/chaijs/chai/pull/217) Chai tests can be run with `--watch`. [@demands](https://github.com/demands) 357 - [#219](https://github.com/chaijs/chai/pull/219) Add overwriteChainableMethod utility. [@demands](https://github.com/demands) 358 - [#224](https://github.com/chaijs/chai/pull/224) Return error on throw method to chain on error properties. [@vbardales](https://github.com/vbardales) 359 - [#226](https://github.com/chaijs/chai/pull/226) Add `has` to language chains. [@duncanbeevers](https://github.com/duncanbeevers) 360 - [#230](https://github.com/chaijs/chai/pull/230) Support `{a:1,b:2}.should.include({a:1})` [@jkroso](https://github.com/jkroso) 361 - [#231](https://github.com/chaijs/chai/pull/231) Update Copyright notices to 2014 [@duncanbeevers](https://github.com/duncanbeevers) 362 - [#232](https://github.com/chaijs/chai/pull/232) Avoid error instantiation if possible on assert.throws. [@laconbass](https://github.com/laconbass) 363 364 Thank you to all who took time to contribute! 365 366 ### Other Bug Fixes 367 368 - [#225](https://github.com/chaijs/chai/pull/225) Improved AMD wrapper provided by upstream `component(1)`. 369 - [#185](https://github.com/chaijs/chai/issues/185) `assert.throws()` returns thrown error for further assertions. 370 - [#237](https://github.com/chaijs/chai/pull/237) Remove coveralls/jscoverage, include istanbul coverage report in travis test. 371 - Update Karma and Sauce runner versions for consistent CI results. No more karma@canary. 372 373 ## 1.8.1 / 2013-10-10 374 375 The following changes are required if you are upgrading from the previous version: 376 377 - **Users:** 378 - Refresh `node_modules` folder for updated dependencies. 379 - **Plugin Developers:** 380 - No changes required 381 - **Core Contributors:** 382 - Refresh `node_modules` folder for updated dependencies. 383 384 ### Browserify 385 386 This is a small patch that updates the dependency tree so browserify users can install 387 chai. (Remove conditional requires) 388 389 ## 1.8.0 / 2013-09-18 390 391 The following changes are required if you are upgrading from the previous version: 392 393 - **Users:** 394 - See `deep.equal` notes. 395 - **Plugin Developers:** 396 - No changes required 397 - **Core Contributors:** 398 - Refresh `node_modules` folder for updated dependencies. 399 400 ### Deep Equals 401 402 This version of Chai focused on a overhaul to the deep equal utility. The code for this 403 tool has been removed from the core lib and can now be found at: 404 [chai / deep-eql](https://github.com/chaijs/deep-eql). As stated in previous releases, 405 this is part of a larger initiative to provide transparency, independent testing, and coverage for 406 some of the more complicated internal tools. 407 408 For the most part `.deep.equal` will behave the same as it has. However, in order to provide a 409 consistent ruleset across all types being tested, the following changes have been made and _might_ 410 require changes to your tests. 411 412 **1.** Strict equality for non-traversable nodes according to [egal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). 413 414 _Previously:_ Non-traversable equal via `===`. 415 416 ```js 417 expect(NaN).to.deep.equal(NaN); 418 expect(-0).to.not.deep.equal(+0); 419 ``` 420 421 **2.** Arguments are not Arrays (and all types must be equal): 422 423 _Previously:_ Some crazy nonsense that led to empty arrays deep equaling empty objects deep equaling dates. 424 425 ```js 426 expect(arguments).to.not.deep.equal([]); 427 expect(Array.prototype.slice.call(arguments)).to.deep.equal([]); 428 ``` 429 430 - [#156](https://github.com/chaijs/chai/issues/156) Empty object is eql to empty array 431 - [#192](https://github.com/chaijs/chai/issues/192) empty object is eql to a Date object 432 - [#194](https://github.com/chaijs/chai/issues/194) refactor deep-equal utility 433 434 ### CI and Browser Testing 435 436 Chai now runs the browser CI suite using [Karma](http://karma-runner.github.io/) directed at 437 [SauceLabs](https://saucelabs.com/). This means we get to know where our browser support stands... 438 and we get a cool badge: 439 440 [![Selenium Test Status](https://saucelabs.com/browser-matrix/logicalparadox.svg)](https://saucelabs.com/u/logicalparadox) 441 442 Look for the list of browsers/versions to expand over the coming releases. 443 444 - [#195](https://github.com/chaijs/chai/issues/195) karma test framework 445 446 ## 1.7.2 / 2013-06-27 447 448 The following changes are required if you are upgrading from the previous version: 449 450 - **Users:** 451 - No changes required. 452 - **Plugin Developers:** 453 - No changes required 454 - **Core Contributors:** 455 - Refresh `node_modules` folder for updated dependencies. 456 457 ### Coverage Reporting 458 459 Coverage reporting has always been available for core-developers but the data has never been published 460 for our end users. In our ongoing effort to improve accountability this data will now be published via 461 the [coveralls.io](https://coveralls.io/) service. A badge has been added to the README and the full report 462 can be viewed online at the [chai coveralls project](https://coveralls.io/r/chaijs/chai). Furthermore, PRs 463 will receive automated messages indicating how their PR impacts test coverage. This service is tied to TravisCI. 464 465 ### Other Fixes 466 467 - [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`. (Fix ignore all) 468 469 ## 1.7.1 / 2013-06-24 470 471 The following changes are required if you are upgrading from the previous version: 472 473 - **Users:** 474 - No changes required. 475 - **Plugin Developers:** 476 - No changes required 477 - **Core Contributors:** 478 - Refresh `node_modules` folder for updated dependencies. 479 480 ### Official Bower Support 481 482 Support has been added for the Bower Package Manager ([bower.io])(http://bower.io/). Though 483 Chai could be installed via Bower in the past, this update adds official support via the `bower.json` 484 specification file. 485 486 - [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`. 487 488 ## 1.7.0 / 2013-06-17 489 490 The following changes are required if you are upgrading from the previous version: 491 492 - **Users:** 493 - No changes required. 494 - **Plugin Developers:** 495 - Review AssertionError update notice. 496 - **Core Contributors:** 497 - Refresh `node_modules` folder for updated dependencies. 498 499 ### AssertionError Update Notice 500 501 Chai now uses [chaijs/assertion-error](https://github.com/chaijs/assertion-error) instead an internal 502 constructor. This will allow for further iteration/experimentation of the AssertionError constructor 503 independant of Chai. Future plans include stack parsing for callsite support. 504 505 This update constructor has a different constructor param signature that conforms more with the standard 506 `Error` object. If your plugin throws and `AssertionError` directly you will need to update your plugin 507 with the new signature. 508 509 ```js 510 var AssertionError = require('chai').AssertionError; 511 512 /** 513 * previous 514 * 515 * @param {Object} options 516 */ 517 518 throw new AssertionError({ 519 message: 'An assertion error occurred' 520 , actual: actual 521 , expect: expect 522 , startStackFunction: arguments.callee 523 , showStack: true 524 }); 525 526 /** 527 * new 528 * 529 * @param {String} message 530 * @param {Object} options 531 * @param {Function} start stack function 532 */ 533 534 throw new AssertionError('An assertion error occurred', { 535 actual: actual 536 , expect: expect 537 , showStack: true 538 }, arguments.callee); 539 540 // other signatures 541 throw new AssertionError('An assertion error occurred'); 542 throw new AssertionError('An assertion error occurred', null, arguments.callee); 543 ``` 544 545 #### External Dependencies 546 547 This is the first non-developement dependency for Chai. As Chai continues to evolve we will begin adding 548 more; the next will likely be improved type detection and deep equality. With Chai's userbase continually growing 549 there is an higher need for accountability and documentation. External dependencies will allow us to iterate and 550 test on features independent from our interfaces. 551 552 Note: The browser packaged version `chai.js` will ALWAYS contain all dependencies needed to run Chai. 553 554 ### Community Contributions 555 556 - [#169](https://github.com/chaijs/chai/pull/169) Fix deep equal comparison for Date/Regexp types. [@katsgeorgeek](https://github.com/katsgeorgeek) 557 - [#171](https://github.com/chaijs/chai/pull/171) Add `assert.notOk()`. [@Bartvds](https://github.com/Bartvds) 558 - [#173](https://github.com/chaijs/chai/pull/173) Fix `inspect` utility. [@domenic](https://github.com/domenic) 559 560 Thank you to all who took the time to contribute! 561 562 ## 1.6.1 / 2013-06-05 563 564 The following changes are required if you are upgrading from the previous version: 565 566 - **Users:** 567 - No changes required. 568 - **Plugin Developers:** 569 - No changes required. 570 - **Core Contributors:** 571 - Refresh `node_modules` folder for updated developement dependencies. 572 573 ### Deep Equality 574 575 Regular Expressions are now tested as part of all deep equality assertions. In previous versions 576 they silently passed for all scenarios. Thanks to [@katsgeorgeek](https://github.com/katsgeorgeek) for the contribution. 577 578 ### Community Contributions 579 580 - [#161](https://github.com/chaijs/chai/pull/161) Fix documented name for assert interface's isDefined method. [@brandonpayton](https://github.com/brandonpayton) 581 - [#168](https://github.com/chaijs/chai/pull/168) Fix comparison equality of two regexps for when using deep equality. [@katsgeorgeek](https://github.com/katsgeorgeek) 582 583 Thank you to all who took the time to contribute! 584 585 ### Additional Notes 586 587 - Mocha has been locked at version `1.8.x` to ensure `mocha-phantomjs` compatibility. 588 589 ## 1.6.0 / 2013-04-29 590 591 The following changes are required if you are upgrading from the previous version: 592 593 - **Users:** 594 - No changes required. 595 - **Plugin Developers:** 596 - No changes required. 597 - **Core Contributors:** 598 - Refresh `node_modules` folder for updated developement dependencies. 599 600 ### New Assertions 601 602 #### Array Members Inclusion 603 604 Asserts that the target is a superset of `set`, or that the target and `set` have the same members. 605 Order is not taken into account. Thanks to [@NickHeiner](https://github.com/NickHeiner) for the contribution. 606 607 ```js 608 // (expect/should) full set 609 expect([4, 2]).to.have.members([2, 4]); 610 expect([5, 2]).to.not.have.members([5, 2, 1]); 611 612 // (expect/should) inclusion 613 expect([1, 2, 3]).to.include.members([3, 2]); 614 expect([1, 2, 3]).to.not.include.members([3, 2, 8]); 615 616 // (assert) full set 617 assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members'); 618 619 // (assert) inclusion 620 assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members'); 621 622 ``` 623 624 #### Non-inclusion for Assert Interface 625 626 Most `assert` functions have a negative version, like `instanceOf()` has a corresponding `notInstaceOf()`. 627 However `include()` did not have a corresponding `notInclude()`. This has been added. 628 629 ```js 630 assert.notInclude([ 1, 2, 3 ], 8); 631 assert.notInclude('foobar', 'baz'); 632 ``` 633 634 ### Community Contributions 635 636 - [#140](https://github.com/chaijs/chai/pull/140) Restore `call`/`apply` methods for plugin interface. [@RubenVerborgh](https://github.com/RubenVerborgh) 637 - [#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) 638 639 Thank you to all who took time to contribute! 640 641 ### Other Bug Fixes 642 643 - [#142](https://github.com/chaijs/chai/issues/142) `assert#include` will no longer silently pass on wrong-type haystack. 644 - [#158](https://github.com/chaijs/chai/issues/158) `assert#notInclude` has been added. 645 - 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. 646 647 ## 1.5.0 / 2013-02-03 648 649 ### Migration Requirements 650 651 The following changes are required if you are upgrading from the previous version: 652 653 - **Users:** 654 - _Update [2013-02-04]:_ Some users may notice a small subset of deep equality assertions will no longer pass. This is the result of 655 [#120](https://github.com/chaijs/chai/issues/120), an improvement to our deep equality algorithm. Users will need to revise their assertions 656 to be more granular should this occur. Further information: [#139](https://github.com/chaijs/chai/issues/139). 657 - **Plugin Developers:** 658 - No changes required. 659 - **Core Contributors:** 660 - Refresh `node_modules` folder for updated developement dependencies. 661 662 ### Community Contributions 663 664 - [#126](https://github.com/chaijs/chai/pull/126): Add `eqls` alias for `eql`. [@RubenVerborgh](https://github.com/RubenVerborgh) 665 - [#127](https://github.com/chaijs/chai/issues/127): Performance refactor for chainable methods. [@RubenVerborgh](https://github.com/RubenVerborgh) 666 - [#133](https://github.com/chaijs/chai/pull/133): Assertion `.throw` support for primitives. [@RubenVerborgh](https://github.com/RubenVerborgh) 667 - [#137](https://github.com/chaijs/chai/issues/137): Assertion `.throw` support for empty messages. [@timnew](https://github.com/timnew) 668 - [#136](https://github.com/chaijs/chai/pull/136): Fix backward negation messages when using `.above()` and `.below()`. [@whatthejeff](https://github.com/whatthejeff) 669 670 Thank you to all who took time to contribute! 671 672 ### Other Bug Fixes 673 674 - Improve type detection of `.a()`/`.an()` to work in cross-browser scenarios. 675 - [#116](https://github.com/chaijs/chai/issues/116): `.throw()` has cleaner display of errors when WebKit browsers. 676 - [#120](https://github.com/chaijs/chai/issues/120): `.eql()` now works to compare dom nodes in browsers. 677 678 679 ### Usage Updates 680 681 #### For Users 682 683 **1. Component Support:** Chai now included the proper configuration to be installed as a 684 [component](https://github.com/component/component). Component users are encouraged to consult 685 [chaijs.com](http://chaijs.com) for the latest version number as using the master branch 686 does not gaurantee stability. 687 688 ```js 689 // relevant component.json 690 devDependencies: { 691 "chaijs/chai": "1.5.0" 692 } 693 ``` 694 695 Alternatively, bleeding-edge is available: 696 697 $ component install chaijs/chai 698 699 **2. Configurable showDiff:** Some test runners (such as [mocha](http://visionmedia.github.com/mocha/)) 700 include support for showing the diff of strings and objects when an equality error occurs. Chai has 701 already included support for this, however some users may not prefer this display behavior. To revert to 702 no diff display, the following configuration is available: 703 704 ```js 705 chai.Assertion.showDiff = false; // diff output disabled 706 chai.Assertion.showDiff = true; // default, diff output enabled 707 ``` 708 709 #### For Plugin Developers 710 711 **1. New Utility - type**: The new utility `.type()` is available as a better implementation of `typeof` 712 that can be used cross-browser. It handles the inconsistencies of Array, `null`, and `undefined` detection. 713 714 - **@param** _{Mixed}_ object to detect type of 715 - **@return** _{String}_ object type 716 717 ```js 718 chai.use(function (c, utils) { 719 // some examples 720 utils.type({}); // 'object' 721 utils.type(null); // `null' 722 utils.type(undefined); // `undefined` 723 utils.type([]); // `array` 724 }); 725 ``` 726 727 #### For Core Contributors 728 729 **1. Browser Testing**: Browser testing of the `./chai.js` file is now available in the command line 730 via PhantomJS. `make test` and Travis-CI will now also rebuild and test `./chai.js`. Consequently, all 731 pull requests will now be browser tested in this way. 732 733 _Note: Contributors opening pull requests should still NOT include the browser build._ 734 735 **2. SauceLabs Testing**: Early SauceLab support has been enabled with the file `./support/mocha-cloud.js`. 736 Those interested in trying it out should create a free [Open Sauce](https://saucelabs.com/signup/plan) account 737 and include their credentials in `./test/auth/sauce.json`.