@@ -46,8 +46,7 @@ describe('Mock Timers Test Suite', () => {
4646 code : 'ERR_INVALID_ARG_VALUE' ,
4747 } ) ;
4848 } ) ;
49-
50- it ( 'should check that propertyDescriptor gets back after reseting timers' , ( t ) => {
49+ it ( 'should check that propertyDescriptor gets back after resetting timers' , ( t ) => {
5150 const getDescriptor = ( ctx , fn ) => Object . getOwnPropertyDescriptor ( ctx , fn ) ;
5251 const getCurrentTimersDescriptors = ( ) => {
5352 const timers = [
@@ -71,26 +70,36 @@ describe('Mock Timers Test Suite', () => {
7170 nodeTimersPromises : nodeTimersPromisesDescriptors ,
7271 } ;
7372 } ;
74- const before = getCurrentTimersDescriptors ( ) ;
73+
74+ const originalDescriptors = getCurrentTimersDescriptors ( ) ;
75+
7576 t . mock . timers . enable ( ) ;
7677 const during = getCurrentTimersDescriptors ( ) ;
7778 t . mock . timers . reset ( ) ;
7879 const after = getCurrentTimersDescriptors ( ) ;
7980
80- assert . deepStrictEqual (
81- before ,
82- after ,
83- ) ;
81+ for ( const env in originalDescriptors ) {
82+ for ( const prop in originalDescriptors [ env ] ) {
83+ const originalDescriptor = originalDescriptors [ env ] [ prop ] ;
84+ const afterDescriptor = after [ env ] [ prop ] ;
8485
85- assert . notDeepStrictEqual (
86- before ,
87- during ,
88- ) ;
86+ assert . deepStrictEqual (
87+ originalDescriptor ,
88+ afterDescriptor ,
89+ ) ;
8990
90- assert . notDeepStrictEqual (
91- during ,
92- after ,
93- ) ;
91+ assert . notDeepStrictEqual (
92+ originalDescriptor ,
93+ during [ env ] [ prop ] ,
94+ ) ;
95+
96+ assert . notDeepStrictEqual (
97+ during [ env ] [ prop ] ,
98+ after [ env ] [ prop ] ,
99+ ) ;
100+
101+ }
102+ }
94103 } ) ;
95104
96105 it ( 'should reset all timers when calling .reset function' , ( t ) => {
0 commit comments