Closed gywbd closed 10 years ago
if i throw an error in a constructor, the should.throw() doesn't work.
function Constructor() { throw new Error('fail'); }
(new Constructor()).should.throw() cannot pass.
Yes, that is expected. Because new Constructor() will return object, but .throw() expect a function.
new Constructor()
.throw()
(function() { new Constructor() }).should.throw()
if i throw an error in a constructor, the should.throw() doesn't work.
function Constructor() { throw new Error('fail'); }
(new Constructor()).should.throw() cannot pass.