Skip to content

Commit ee4806f

Browse files
author
Brian Vaughn
committed
Fixed flushing problem with tests
1 parent 9d4fd7a commit ee4806f

File tree

1 file changed

+6
-4
lines changed
  • packages/react-devtools-shared/src/__tests__

1 file changed

+6
-4
lines changed

packages/react-devtools-shared/src/__tests__/utils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ export function act(callback: Function): void {
1818
});
1919

2020
// Flush Bridge operations
21-
actDOM(() => {
22-
actTestRenderer(() => {
23-
jest.runAllTimers();
21+
while (global.mockGetTimersCount() > 0) {
22+
actDOM(() => {
23+
actTestRenderer(() => {
24+
jest.runAllTimers();
25+
});
2426
});
25-
});
27+
}
2628
}
2729

2830
export async function actAsync(

0 commit comments

Comments
 (0)