Skip to content

Commit

Permalink
Fixed flushing problem with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Aug 26, 2019
1 parent 9d4fd7a commit ee4806f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-devtools-shared/src/__tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ee4806f

Please sign in to comment.