Docs (4.0.0)
class TestCase method

expectOutputAsync

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

expectOutputAsync(timeout: number, ...select: OutputSelectFilter[]): Promise<OutputAssertion>

Notes

Parameters

  • timeout — Timeout, in milliseconds
  • select — A set of output filters to match

Return value

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

Example

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

Related