diff --git a/packages/react-devtools-shared/src/__tests__/utils.js b/packages/react-devtools-shared/src/__tests__/utils.js index 4c28732e65df2..bd652d7381c65 100644 --- a/packages/react-devtools-shared/src/__tests__/utils.js +++ b/packages/react-devtools-shared/src/__tests__/utils.js @@ -18,11 +18,13 @@ export function act(callback: Function): void { }); // Flush Bridge operations - actDOM(() => { - actTestRenderer(() => { - jest.runAllTimers(); + while (global.mockGetTimersCount() > 0) { + actDOM(() => { + actTestRenderer(() => { + jest.runAllTimers(); + }); }); - }); + } } export async function actAsync(