tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 194 forks source link

Problem using console.log #154

Closed popomore closed 10 years ago

popomore commented 10 years ago
$ node
> require('should')
2
> 

node v0.10.6 should 2.1.0


Maybe should.inspect cause this problem.

https://github.com/joyent/node/blob/22c68fdc1dae40f0ed9c71a02f66e5b2c6353691/lib/util.js#L218

btd commented 10 years ago

Yes agree actual bug in node.js util.inspect (should.inspect just export it). See:

$ node 
> require('should')
2
> var should = require('should')
undefined
> should instanceof Function
true
> should(true).be.true
{ obj: true }

So it is just wrong output from util.inspect that does not show Function.

btd commented 10 years ago

I reread your comment. You are right. util.inspect uses should.inspect, but was change that makes should.inspect to be not util.inspect. I will think how to make that working together, seems i have choosed bad name for should.inspect.

btd commented 10 years ago

I pushed 2.2.1, it fixes this issue. Thank you for report.