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

merged 2 commits into from Oct 29, 2012


None yet
2 participants

maxbrunsfeld commented Oct 28, 2012

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

maxbrunsfeld added some commits Mar 5, 2012

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.
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 added a commit that referenced this pull request Oct 29, 2012

Merge pull request #290 from maxbrunsfeld/smaller-pretty-print2
smaller, more configurable pretty-printing of objects

@ragaskar ragaskar merged commit 74cdc5a into jasmine:master Oct 29, 2012


ragaskar commented 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