Skip to content

armgit / mocha

Public Imported from GitHub
0

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

added arity tests

Tj Holowaychuk44a8a3d3249f
diff --git a/test/runnable.js b/test/runnable.js
index 22013557..b7f379af 100644
--- a/test/runnable.js
+++ b/test/runnable.js
@@ -2,7 +2,7 @@
var mocha = require('../')
, Runnable = mocha.Runnable;
-describe('Runnable', function(){
+describe('Runnable(title, fn)', function(){
describe('#timeout(ms)', function(){
it('should set the timeout', function(){
var run = new Runnable;
@@ -10,4 +10,26 @@ describe('Runnable', function(){
run.timeout().should.equal(1000);
})
})
+
+ describe('.title', function(){
+ it('should be present', function(){
+ new Runnable('foo').title.should.equal('foo');
+ })
+ })
+
+ describe('when arity >= 1', function(){
+ it('should be .async', function(){
+ var run = new Runnable('foo', function(done){});
+ run.async.should.equal(1);
+ run.sync.should.be.false;
+ })
+ })
+
+ describe('when arity == 0', function(){
+ it('should be .sync', function(){
+ var run = new Runnable('foo', function(){});
+ run.async.should.be.equal(0);
+ run.sync.should.be.true;
+ })
+ })
})
\ No newline at end of file