@samitouri / QOS-React-2 / commits / ee4806f47a

Fixed flushing problem with tests

Brian Vaughn committed Aug 26, 2019 at 13:08 UTC ee4806f47ae594ea20b5296dd913ed67d7809b86
1 file changed +6 -4
packages/react-devtools-shared/src/__tests__/utils.js
+6 -4
@@ -18,11 +18,13 @@ export function act(callback: Function): void {
18 });
19
20 // Flush Bridge operations
21 - actDOM(() => {
22 - actTestRenderer(() => {
23 - jest.runAllTimers();
21 + while (global.mockGetTimersCount() > 0) {
22 + actDOM(() => {
23 + actTestRenderer(() => {
24 + jest.runAllTimers();
25 + });
26 });
25 - });
27 + }
28 }
29
30 export async function actAsync(