Fixed flushing problem with tests

This commit is contained in:
Brian Vaughn
2019-08-26 13:08:35 -07:00
parent 9d4fd7a249
commit ee4806f47a

View File

@@ -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(