File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed
packages-internal/test-utils/src Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,15 @@ function createClock(
221221 vi . setSystemTime ( config ) ;
222222 }
223223 } ) ;
224+
225+ afterEach ( async ( ) => {
226+ if ( vi . isFakeTimers ( ) ) {
227+ await rtlAct ( async ( ) => {
228+ vi . runOnlyPendingTimers ( ) ;
229+ } ) ;
230+ vi . useRealTimers ( ) ;
231+ }
232+ } ) ;
224233 } else {
225234 beforeEach ( ( ) => {
226235 if ( config ) {
@@ -229,15 +238,6 @@ function createClock(
229238 } ) ;
230239 }
231240
232- afterEach ( async ( ) => {
233- if ( vi . isFakeTimers ( ) ) {
234- await rtlAct ( async ( ) => {
235- vi . runOnlyPendingTimers ( ) ;
236- } ) ;
237- vi . useRealTimers ( ) ;
238- }
239- } ) ;
240-
241241 return {
242242 withFakeTimers : ( ) => {
243243 if ( vi . isFakeTimers ( ) ) {
@@ -266,6 +266,15 @@ function createClock(
266266 vi . setSystemTime ( config ) ;
267267 }
268268 } ) ;
269+
270+ afterEach ( async ( ) => {
271+ if ( vi . isFakeTimers ( ) ) {
272+ await rtlAct ( async ( ) => {
273+ vi . runOnlyPendingTimers ( ) ;
274+ } ) ;
275+ vi . useRealTimers ( ) ;
276+ }
277+ } ) ;
269278 } ,
270279 runToLast : ( ) => {
271280 rtlAct ( ( ) => {
You can’t perform that action at this time.
0 commit comments