Skip to main content
The four matchers that assert on what a component asked the host to do.

Type Declaration

toHaveNavigatedTo()

Passes when tap.nav.push was called with exactly that path.

Parameters

received
unknown
path
string

Returns

MatcherResult

toHaveRunAction()

Passes when tap.actions.run was called with that action, and with input deep-equal to input when one is given.

Parameters

received
unknown
actionId
string
input?
unknown

Returns

MatcherResult

toHaveStored()

Passes when the mock’s storage holds a document deep-equal to that one in that collection.

Parameters

received
unknown
collection
string
document
unknown

Returns

MatcherResult

toHaveToasted()

Passes when a toast matched the string exactly, or the pattern anywhere.

Parameters

received
unknown
expected
string | RegExp

Returns

MatcherResult

Remarks

Each takes the mock renderWithTap returns, so the assertion is expect(mock).toHaveToasted(…) rather than expect(component); anything else throws a TapError carrying TAP_TEST_TARGET_INVALID. A failure names every call that was recorded, so a wrong path or message reads without a debugger. The vitest and jest presets register these, and both declare the four on the runner’s own Matchers interface, so expect(mock).toHaveToasted typechecks once the preset is in the setup files.

Example