在没有CLI的情况下使用摩卡ia Nodejs-App

我想在节点应用程序whitout CLI中使用Mocha(JS Testing)。

如果我做:

var mocha = require('mocha'); var test = new mocha(); test.run(function(err){ if(err){ console.log("Found error"); } }); 

我得到摩卡运行。

但是,我怎么可以添加一个testing?

我需要这样的东西:

 var testcase = { before: function(){}, 'Array': { '#indexOf()': { 'should return -1 when not present': function(){ [1,2,3].indexOf(4).should.equal(-1); } } } }; test.USE(testcase);