Merge branch 'develop' into dbkr/stateafter

This commit is contained in:
Michael Telatynski
2024-11-06 15:42:28 +00:00
committed by GitHub
68 changed files with 556 additions and 644 deletions

View File

@@ -7,6 +7,7 @@ Please see LICENSE files in the repository root for full details.
*/
import EventEmitter from "events";
import { act } from "jest-matrix-react";
import { ActionPayload } from "../../src/dispatcher/payloads";
import defaultDispatcher from "../../src/dispatcher/dispatcher";
@@ -119,7 +120,7 @@ export function untilEmission(
});
}
export const flushPromises = async () => await new Promise<void>((resolve) => window.setTimeout(resolve));
export const flushPromises = () => act(async () => await new Promise<void>((resolve) => window.setTimeout(resolve)));
// with jest's modern fake timers process.nextTick is also mocked,
// flushing promises in the normal way then waits for some advancement