pivotal/jasmine — Issue #187: PrettyPrinter emits very long string
Author: OttoAllmendinger
Created: 2012-02-21 15:05:17+00:00
State: open

I'm using Jasmine to test the existence of a Backbone Model instance, expecting it to be falsy.

expect(model).toBeFalsy();

In one case `model` was truthy, and Jasmine wanted to present a nicely formatted string of the model, causing the page to hang because the object graph was too big and the string concatenation is inefficient (this.string += value)

I think it would be better to

* stop formatting after the string has ~100 chars
* use an array to collect the values and yield the string via `this.values.join("")`