Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

another test

Tj Holowaychuk94f1eed54dd5
diff --git a/test/runnable.js b/test/runnable.js
index c9e3599f..5c5c64fa 100644
--- a/test/runnable.js
+++ b/test/runnable.js
@@ -48,6 +48,22 @@ describe('Runnable(title, fn)', function(){
})
})
})
+
+ describe('when throwing an exception', function(){
+ it('should invoke the callback', function(done){
+ var calls = 0;
+ var test = new Runnable('foo', function(){
+ ++calls;
+ throw new Error('fail');
+ });
+
+ test.run(function(err){
+ calls.should.equal(1);
+ err.message.should.equal('fail');
+ done();
+ })
+ })
+ })
})
})
})
\ No newline at end of file