[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Assert](https://evolu.dev/docs/api-reference/common/Assert) › assertContinuationAfterMicrotasks

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

Defined in: [packages/common/src/Assert.ts:317](https://github.com/evoluhq/evolu/blob/ecbac001e0c18bbc45b44715f49ecc3a768c5ec9/packages/common/src/Assert.ts#L317)

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

```ts

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