Documentation

API Referencefunction

function expectOutputAsync()

Waits for output to be rendered (by the test renderer) that matches the provided filters.

function expectOutputAsync(
select: OutputSelectFilter & {
timeout?: number;
},
...nested: OutputSelectFilter[]
): Promise<OutputAssertion>;

Notes

Parameters

Return value

A promise that’s resolved to an OutputAssertion instance for matching output, or rejected when a timeout occurs.

Examples

test("Wait for output", async (t) => {
  // ... render output somehow
  await expectOutputAsync({ type: "button" });
});