Closed erelsgl closed 11 years ago
In should.js we are using util.inspect function to show objects, but it is bad we do not expose it to public. Probably we should. For now I only can suggest two workarounds:
.inspect
method and call in this method util.inspect with required options. In next release i will add inspect function to exported object.
Reproduced. It is important that it is happen outside test runner. In v2 I expose inspect as should.inspect
.
OK, thanks.
I compared to deep objects with should.eql, and got the following message: expected
{ classes: [ '{"Greet":true}' ], explanation: [ 'hi', [ 'depth=1: Greet', [Object], 'depth=2: true', [Object] ] ] }
to equal
{ classes: [ '{"Greet":true}' ], explanation: [ 'hi', [ 'depth=1: Greet', [Object], 'depth=2: true', [Object] ] ] }
Probably, the difference is within the [Object], but it is not seen. I think there should be a way to control the depth of objects that are displayed in such messages.