@@ -135,27 +135,15 @@ class Runner extends EventEmitter {
135
135
* @public
136
136
* @class
137
137
* @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
139
139
* @param {boolean } [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done.
140
140
* @param {boolean } [opts.delay] - Whether to delay execution of root suite until ready.
141
141
* @param {boolean } [opts.dryRun] - Whether to report tests without running them.
142
142
* @param {boolean } [opts.failZero] - Whether to fail test run if zero tests encountered.
143
143
*/
144
- constructor ( suite , opts ) {
144
+ constructor ( suite , opts = { } ) {
145
145
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
+
159
147
var self = this ;
160
148
this . _globals = [ ] ;
161
149
this . _abort = false ;
@@ -1066,7 +1054,7 @@ Runner.prototype.run = function (fn, opts = {}) {
1066
1054
debug ( 'run(): filtered exclusive Runnables' ) ;
1067
1055
}
1068
1056
this . state = constants . STATE_RUNNING ;
1069
- if ( this . _delay ) {
1057
+ if ( this . _opts . delay ) {
1070
1058
this . emit ( constants . EVENT_DELAY_END ) ;
1071
1059
debug ( 'run(): "delay" ended' ) ;
1072
1060
}
@@ -1093,7 +1081,7 @@ Runner.prototype.run = function (fn, opts = {}) {
1093
1081
this . _addEventListener ( process , 'uncaughtException' , this . uncaught ) ;
1094
1082
this . _addEventListener ( process , 'unhandledRejection' , this . unhandled ) ;
1095
1083
1096
- if ( this . _delay ) {
1084
+ if ( this . _opts . delay ) {
1097
1085
// for reporters, I guess.
1098
1086
// might be nice to debounce some dots while we wait.
1099
1087
this . emit ( constants . EVENT_DELAY_BEGIN , rootSuite ) ;
0 commit comments