Skip to content

Commit

Permalink
Fix flacky test based on time (#95069)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcaires authored Oct 22, 2024
1 parent 791ec29 commit 185ed64
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ jest.mock( 'i18n-calypso' ); // Mock the useTranslate hook
jest.mock( 'calypso/state' ); // Mock the useDispatch hook

describe( 'BackupRealtimeMessage', () => {
beforeAll( () => {
jest.useFakeTimers();
} );

afterAll( () => {
jest.useRealTimers();
} );

const renderMessage = ( baseBackupDate, eventsCount, selectedDate, learnMoreUrl ) => {
return render(
<BackupRealtimeMessage
Expand Down

0 comments on commit 185ed64

Please sign in to comment.