visionmedia/supertest — pull request #65 by kevinoid (2013-06-02 19:51:04+00:00)
Title: Improve response body mismatch error message

**Reviewer Note:** I realize this may not be something you're interested in supporting. It has the down-side of changing behavior based on which modules are available. But I have found it to improve the usefulness of supertest a lot for my use cases and thought you might want to consider it.

If the parsed response body does not match the expected value, the
current output is only really useful in cases where the difference is
readily apparent or the body is small and the difference is in the
outermost object or its child. Otherwise the user may need to scroll
through large amounts of output and the mismatch may not be visible due
to the depth limit of util.inspect.

To make finding the source of inequality easier for users, make use of
either should or Chai assertions (which print very useful messages in
most test frameworks). When neither should nor Chai is available,
include the entire object in the output to allow users to find the
inequality when it is not in the outermost object or its child.

Signed-off-by: Kevin Locke