MatthewMueller/cheerio — pull request #400 by jugglinmike (2014-02-28 03:18:20+00:00)
Title: Update to latest version of expect.js

In #350, @fb55 and I discovered that the latest version of `expect.js` (0.3.1) caused false positives in Cheerio's unit test suite. Worse, the generated error was causing Mocha to crash, so TravisCI was unaware that the build was failing. (Actually, you might say this was a good thing because the errors were false positives anyway. But I would argue with you :P)

This problem was introduced [when `expect.js` corrected the parameter order of its `eql` comparator](https://github.com/LearnBoost/expect.js/pull/56). This was a legitimate bug fix--it corrected semantics where (functionally speaking) order has no value.

Or it *should* have no value. Actually, the comparison internal logic has a flaw which makes it non-reflexive. [I've submitted a patch against `expect.js` to remedy this](https://github.com/LearnBoost/expect.js/pull/102) and [a separate patch to Node.js](https://github.com/joyent/node/pull/7178) (since `expect.js`'s implementation is derived from there).

...but that has little significance to the problem in our test suite--an `arguments` object should never be considered equivalent to an Array instance. That's why I'm updating the tests to convert all `arguments` into Arrays before comparison.

As for Mocha: it was crashing while rendering string diffs for the errors generated by `expect.js`. [I've submitted a patch for that, too](https://github.com/visionmedia/mocha/pull/1140), but it shouldn't have any bearing on this change.

Commit message:

> In version 0.3, expect.js corrected the order of its `eql` assertion.
> This exposed several bugs in Cheerio's unit tests, where `aguments`
> objects were being tested for deep equality with Array instances.