Skip to content

armgit / mocha

Public Imported from GitHub
0

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

.run() test

Tj Holowaychukfa765228c31d
diff --git a/test/runnable.js b/test/runnable.js
index b7f379af..c9e3599f 100644
--- a/test/runnable.js
+++ b/test/runnable.js
@@ -32,4 +32,22 @@ describe('Runnable(title, fn)', function(){
run.sync.should.be.true;
})
})
+
+ describe('.run(fn)', function(){
+ describe('when sync', function(){
+ describe('without error', function(){
+ it('should invoke the callback', function(done){
+ var calls = 0;
+ var test = new Runnable('foo', function(){
+ ++calls;
+ });
+
+ test.run(function(err){
+ calls.should.equal(1);
+ done(err);
+ })
+ })
+ })
+ })
+ })
})
\ No newline at end of file