text: function Suite(t,e){this.title=t;var i=function(){};i.prototype=e,this.ctx=new i,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var EventEmitter=require("events").EventEmitter,debug=require("debug")("mocha:suite"),milliseconds=require("./ms"),utils=require("./utils"),Hook=require("./hook");exports=module.exports=Suite,exports.create=function(t,e){var i=new Suite(e,t.ctx);return i.parent=t,t.pending&&(i.pending=!0),e=i.fullTitle(),t.addSuite(i),i},Suite.prototype.__proto__=EventEmitter.prototype,Suite.prototype.clone=function(){var t=new Suite(this.title);return debug("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},Suite.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=milliseconds(t)),debug("timeout %d",t),this._timeout=parseInt(t,10),this)},Suite.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=milliseconds(t)),debug("slow %d",t),this._slow=t,this)},Suite.prototype.bail=function(t){return 0==arguments.length?this._bail:(debug("bail %s",t),this._bail=t,this)},Suite.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var i=new Hook(t,e);return i.parent=this,i.timeout(this.timeout()),i.slow(this.slow()),i.ctx=this.ctx,this._beforeAll.push(i),this.emit("beforeAll",i),this},Suite.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var i=new Hook(t,e);return i.parent=this,i.timeout(this.timeout()),i.slow(this.slow()),i.ctx=this.ctx,this._afterAll.push(i),this.emit("afterAll",i),this},Suite.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var i=new Hook(t,e);return i.parent=this,i.timeout(this.timeout()),i.slow(this.slow()),i.ctx=this.ctx,this._beforeEach.push(i),this.emit("beforeEach",i),this},Suite.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var i=new Hook(t,e);return i.parent=this,i.timeout(this.timeout()),i.slow(this.slow()),i.ctx=this.ctx,this._afterEach.push(i),this.emit("afterEach",i),this},Suite.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},Suite.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},Suite.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},Suite.prototype.total=function(){return utils.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},Suite.prototype.eachTest=function(t){return utils.forEach(this.tests,t),utils.forEach(this.suites,function(e){e.eachTest(t)}),this};