File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ exports.Test = require('./test');
9191 * @param {string } [options.ui] - Interface name.
9292 * @param {boolean } [options.color] - Color TTY output from reporter?
9393 * @param {boolean } [options.useInlineDiffs] - Use inline diffs?
94+ * @prop {Suite } suite - Root Suite instance
95+ * @prop {Runner } runner - Runner instance
9496 */
9597function Mocha ( options ) {
9698 options = utils . assign ( { } , mocharc , options || { } ) ;
@@ -153,6 +155,8 @@ function Mocha(options) {
153155 this [ opt ] ( ) ;
154156 }
155157 } , this ) ;
158+
159+ this . runner = new exports . Runner ( this . suite , options . delay ) ;
156160}
157161
158162/**
@@ -803,10 +807,9 @@ Mocha.prototype.run = function(fn) {
803807 if ( this . files . length ) {
804808 this . loadFiles ( ) ;
805809 }
806- var suite = this . suite ;
807810 var options = this . options ;
808811 options . files = this . files ;
809- var runner = new exports . Runner ( suite , options . delay ) ;
812+ var runner = this . runner ;
810813 createStatsCollector ( runner ) ;
811814 var reporter = new this . _reporter ( runner , options ) ;
812815 runner . ignoreLeaks = options . ignoreLeaks !== false ;
You can’t perform that action at this time.
0 commit comments