File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ class Runner extends EventEmitter {
138
138
* @public
139
139
* @class
140
140
* @param {Suite } suite - Root suite
141
- * @param {Object|boolean } [opts] - Options. If `boolean`, whether or not to delay execution of root suite until ready (for backwards compatibility) .
141
+ * @param {Object|boolean } [opts] - Options. If `boolean` (deprecated) , whether or not to delay execution of root suite until ready.
142
142
* @param {boolean } [opts.delay] - Whether to delay execution of root suite until ready.
143
143
* @param {boolean } [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done.
144
144
*/
@@ -148,7 +148,10 @@ class Runner extends EventEmitter {
148
148
opts = { } ;
149
149
}
150
150
if ( typeof opts === 'boolean' ) {
151
- // TODO: deprecate this
151
+ // TODO: remove this
152
+ require ( './errors' ) . deprecate (
153
+ '"Runner(suite: Suite, delay: boolean)" is deprecated. Use "Runner(suite: Suite, {delay: boolean})" instead.'
154
+ ) ;
152
155
this . _delay = opts ;
153
156
opts = { } ;
154
157
} else {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const {
11
11
MULTIPLE_DONE ,
12
12
UNSUPPORTED
13
13
} = require ( '../../lib/errors' ) . constants ;
14
+ const errors = require ( '../../lib/errors' ) ;
14
15
15
16
const {
16
17
EVENT_HOOK_BEGIN ,
@@ -32,6 +33,15 @@ describe('Runner', function() {
32
33
sinon . restore ( ) ;
33
34
} ) ;
34
35
36
+ describe ( 'constructor deprecation' , function ( ) {
37
+ it ( 'should print a deprecation warning' , function ( ) {
38
+ sinon . stub ( errors , 'deprecate' ) ;
39
+ const suite = new Suite ( 'Suite' , 'root' ) ;
40
+ new Runner ( suite , false ) ; /* eslint no-new: "off" */
41
+ expect ( errors . deprecate , 'was called once' ) ;
42
+ } ) ;
43
+ } ) ;
44
+
35
45
describe ( 'instance method' , function ( ) {
36
46
let suite ;
37
47
let runner ;
You can’t perform that action at this time.
0 commit comments