You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
visionmedia edited this page Jun 19, 2012
·
2 revisions
As of mocha 1.3.0 you may conditionally fail
tests in "after each" hooks by invoking this.test.error(err)
with an instanceof Error.
describe('something',function(){it('should one',function(){this.ok=true;})it('should two',function(){this.ok=false;})afterEach(function(){if(!this.ok)this.test.error(newError('something went wrong'));})})