10
10
assignNewMochaID,
11
11
clamp,
12
12
constants : utilsConstants ,
13
- createMap,
14
13
defineConstants,
15
14
getMochaID,
16
15
inherits,
@@ -92,16 +91,6 @@ function Suite(title, parentContext, isRoot) {
92
91
} ) ;
93
92
94
93
this . reset ( ) ;
95
-
96
- this . on ( 'newListener' , function ( event ) {
97
- if ( deprecatedEvents [ event ] ) {
98
- errors . deprecate (
99
- 'Event "' +
100
- event +
101
- '" is deprecated. Please let the Mocha team know about your use case: https://git.io/v6Lwm'
102
- ) ;
103
- }
104
- } ) ;
105
94
}
106
95
107
96
/**
@@ -614,7 +603,7 @@ var constants = defineConstants(
614
603
*/
615
604
{
616
605
/**
617
- * Event emitted after a test file has been loaded Not emitted in browser.
606
+ * Event emitted after a test file has been loaded. Not emitted in browser.
618
607
*/
619
608
EVENT_FILE_POST_REQUIRE : 'post-require' ,
620
609
/**
@@ -626,70 +615,52 @@ var constants = defineConstants(
626
615
*/
627
616
EVENT_FILE_REQUIRE : 'require' ,
628
617
/**
629
- * Event emitted when `global.run()` is called (use with `delay` option)
618
+ * Event emitted when `global.run()` is called (use with `delay` option).
630
619
*/
631
620
EVENT_ROOT_SUITE_RUN : 'run' ,
632
621
633
622
/**
634
- * Namespace for collection of a `Suite`'s "after all" hooks
623
+ * Namespace for collection of a `Suite`'s "after all" hooks.
635
624
*/
636
625
HOOK_TYPE_AFTER_ALL : 'afterAll' ,
637
626
/**
638
- * Namespace for collection of a `Suite`'s "after each" hooks
627
+ * Namespace for collection of a `Suite`'s "after each" hooks.
639
628
*/
640
629
HOOK_TYPE_AFTER_EACH : 'afterEach' ,
641
630
/**
642
- * Namespace for collection of a `Suite`'s "before all" hooks
631
+ * Namespace for collection of a `Suite`'s "before all" hooks.
643
632
*/
644
633
HOOK_TYPE_BEFORE_ALL : 'beforeAll' ,
645
634
/**
646
- * Namespace for collection of a `Suite`'s "before all " hooks
635
+ * Namespace for collection of a `Suite`'s "before each " hooks.
647
636
*/
648
637
HOOK_TYPE_BEFORE_EACH : 'beforeEach' ,
649
638
650
- // the following events are all deprecated
651
-
652
639
/**
653
- * Emitted after an "after all" `Hook` has been added to a `Suite`. Deprecated
640
+ * Emitted after a child `Suite` has been added to a `Suite`.
641
+ */
642
+ EVENT_SUITE_ADD_SUITE : 'suite' ,
643
+ /**
644
+ * Emitted after an "after all" `Hook` has been added to a `Suite`.
654
645
*/
655
646
EVENT_SUITE_ADD_HOOK_AFTER_ALL : 'afterAll' ,
656
647
/**
657
- * Emitted after an "after each" `Hook` has been added to a `Suite` Deprecated
648
+ * Emitted after an "after each" `Hook` has been added to a `Suite`.
658
649
*/
659
650
EVENT_SUITE_ADD_HOOK_AFTER_EACH : 'afterEach' ,
660
651
/**
661
- * Emitted after an "before all" `Hook` has been added to a `Suite` Deprecated
652
+ * Emitted after an "before all" `Hook` has been added to a `Suite`.
662
653
*/
663
654
EVENT_SUITE_ADD_HOOK_BEFORE_ALL : 'beforeAll' ,
664
655
/**
665
- * Emitted after an "before each" `Hook` has been added to a `Suite` Deprecated
656
+ * Emitted after an "before each" `Hook` has been added to a `Suite`.
666
657
*/
667
658
EVENT_SUITE_ADD_HOOK_BEFORE_EACH : 'beforeEach' ,
668
659
/**
669
- * Emitted after a child `Suite` has been added to a `Suite`. Deprecated
670
- */
671
- EVENT_SUITE_ADD_SUITE : 'suite' ,
672
- /**
673
- * Emitted after a `Test` has been added to a `Suite`. Deprecated
660
+ * Emitted after a `Test` has been added to a `Suite`.
674
661
*/
675
662
EVENT_SUITE_ADD_TEST : 'test'
676
663
}
677
664
) ;
678
665
679
- /**
680
- * @summary There are no known use cases for these events.
681
- * @desc This is a `Set`-like object having all keys being the constant's string value and the value being `true`.
682
- * @todo Remove eventually
683
- * @type {Object<string,boolean> }
684
- * @ignore
685
- */
686
- var deprecatedEvents = Object . keys ( constants )
687
- . filter ( function ( constant ) {
688
- return constant . substring ( 0 , 15 ) === 'EVENT_SUITE_ADD' ;
689
- } )
690
- . reduce ( function ( acc , constant ) {
691
- acc [ constants [ constant ] ] = true ;
692
- return acc ;
693
- } , createMap ( ) ) ;
694
-
695
666
Suite . constants = constants ;
0 commit comments