@@ -135,27 +135,15 @@ class Runner extends EventEmitter {
135135 * @public
136136 * @class
137137 * @param {Suite } suite - Root suite
138- * @param {Object|boolean } [opts] - Options. If `boolean` (deprecated), whether to delay execution of root suite until ready.
138+ * @param {Object } [opts] - Settings object
139139 * @param {boolean } [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done.
140140 * @param {boolean } [opts.delay] - Whether to delay execution of root suite until ready.
141141 * @param {boolean } [opts.dryRun] - Whether to report tests without running them.
142142 * @param {boolean } [opts.failZero] - Whether to fail test run if zero tests encountered.
143143 */
144- constructor ( suite , opts ) {
144+ constructor ( suite , opts = { } ) {
145145 super ( ) ;
146- if ( opts === undefined ) {
147- opts = { } ;
148- }
149- if ( typeof opts === 'boolean' ) {
150- // TODO: remove this
151- require ( './errors' ) . deprecate (
152- '"Runner(suite: Suite, delay: boolean)" is deprecated. Use "Runner(suite: Suite, {delay: boolean})" instead.'
153- ) ;
154- this . _delay = opts ;
155- opts = { } ;
156- } else {
157- this . _delay = opts . delay ;
158- }
146+
159147 var self = this ;
160148 this . _globals = [ ] ;
161149 this . _abort = false ;
@@ -1066,7 +1054,7 @@ Runner.prototype.run = function (fn, opts = {}) {
10661054 debug ( 'run(): filtered exclusive Runnables' ) ;
10671055 }
10681056 this . state = constants . STATE_RUNNING ;
1069- if ( this . _delay ) {
1057+ if ( this . _opts . delay ) {
10701058 this . emit ( constants . EVENT_DELAY_END ) ;
10711059 debug ( 'run(): "delay" ended' ) ;
10721060 }
@@ -1093,7 +1081,7 @@ Runner.prototype.run = function (fn, opts = {}) {
10931081 this . _addEventListener ( process , 'uncaughtException' , this . uncaught ) ;
10941082 this . _addEventListener ( process , 'unhandledRejection' , this . unhandled ) ;
10951083
1096- if ( this . _delay ) {
1084+ if ( this . _opts . delay ) {
10971085 // for reporters, I guess.
10981086 // might be nice to debounce some dots while we wait.
10991087 this . emit ( constants . EVENT_DELAY_BEGIN , rootSuite ) ;
0 commit comments