smaller, more configurable pretty-printing of objects, REBASED #290

merged 2 commits into from Oct 29, 2012


None yet

2 participants


This is a rebase of pull request #196 onto today's master. Thanks!

maxbrunsfeld added some commits Mar 5, 2012
@maxbrunsfeld maxbrunsfeld When pretty-printing objects, don't include inherited properties.
When making assertions about complex objects, Jasmine's
failure message are sometimes gigantic and difficult
to read because the string representation of an object
contains all of the methods and properties in its
prototype chain. This commit causes the pretty printer
to only display on object's own properties.
@maxbrunsfeld maxbrunsfeld Allow users to set the pretty-printer's recursion depth
Currently, jasmine's pretty printer traverses objects
to 40 levels of nesting. If an object is more deeply
nested than that, an exception is thrown. I find that
after a few levels of nesting, the output becomes
difficult to read. The process of serializing such
deep objects also sometimes crashes the browser or
causes a 'slow script' warning.

This commit exposes a 'MAX_PRETTY_PRINT_DEPTH' option.
It also causes the pretty printer to skip over
parts of an object that are nested to deeply by simply
printing out 'Object' or 'Array', rather than throwing
an exception.
@ragaskar ragaskar merged commit 74cdc5a into jasmine:master Oct 29, 2012


@jrreed jrreed referenced this pull request in bradphelan/jasminerice Jan 15, 2013

Release new gem version #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment