expectOutputAsync
Waits for output to be rendered (by the test renderer) that matches the provided filters.
expectOutputAsync(timeout: number, ...select: OutputSelectFilter[]): Promise<OutputAssertion>
Notes
- This method uses TestRenderer.expectOutputAsync(), refer to its documentation for details.
- This method is asynchronous and must be
await
-ed.
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
- class TestCaseA class that represents a single test case, part of a TestScope.