visionmedia / expresso

use mocha
http://visionmedia.github.com/expresso
759 stars 89 forks source link

Bug Fix for Issue # 95 - assert.response hangs when assertion fails #123

Closed mehtryx closed 13 years ago

mehtryx commented 13 years ago

This issue occurs based on the assertion library taking over and throwing an exception when it's base assertions fail, this unfortunately means as soon as a failure occurs no further code executes in expresso after that specific assertion.

I've added try/catch blocks to catch the error assert throws and then call the check() method before issuing an assert.ok(false, err.message) which will of course cause the exception to then be re-thrown.

I've also added colorize where missing in the affected code blocks.

jbarnette commented 13 years ago

See also #108.

mehtryx commented 13 years ago

Excellent, sorry hadn't seen this pull request linked to any bugs, your solution looks better imo, so I'll close this and reference yours on the bug comments.