API reference@evolu/commonAssert › assertContinuationAfterMicrotasks

function assertContinuationAfterMicrotasks(
  promise: Promise<unknown>,
  expectedMicrotaskCount: number,
): Promise<void>;

Defined in: packages/common/src/Assert.ts:317

Asserts that a Promise continuation runs after exactly the specified number of microtasks.

Both fulfillment and rejection count as running the continuation. Use this in tests that intentionally specify async scheduling behavior. Application code must not depend on exact microtask counts. Maintainers should review count changes because they indicate that an async pipeline changed.

Example

import { assertContinuationAfterMicrotasks } from "@evolu/common";

await assertContinuationAfterMicrotasks(Promise.resolve("ready"), 1);