Docs (4.0.0)
class TestRenderer method

expectOutput

Creates an assertion for the currently rendered output with the provided (optional) selection filter(s).

expectOutput(...select: OutputSelectFilter[]): OutputAssertion

Notes

  • This method can be used to validate the current (test) output, and find the subset of output elements that match the given filter(s). Any element in the current output may be matched, including container content; but not content within a matching container (i.e. only the highest-level elements that match a selection filter).
  • If no elements were matched at all, the return value is an OutputAssertion for an empty set of elements. Use the OutputAssertion.toBeRendered() method to validate that the result set is not empty.
  • To wait for output to match a set of selection filters, use the expectOutputAsync() method instead. Note that this is often necessary, since content is rendered asynchronously.

Parameters

  • select — A list of filters to find matching output elements. The first filter is applied, then the second one on all content of matching elements, and so on. Note that multiple elements may be found, which may not be part of the same container.

Return value

An OutputAssertion instance for the matched element(s), or an empty set if no elements matched at all.

Related