Recorded invocations and their outcomes, matching vi.fn()/jest.fn()'s
own .mock object.
Arguments and returned values are kept as unknown rather than
TArgs/TReturn on purpose: a test overriding one of this kit's mock
fields with a fresh, more loosely typed vi.fn()/jest.fn() (a common
per-test override) must stay assignable, and callers reading these almost
always either toEqual(...) the result or cast it explicitly anyway.
results is what makes a factory-shaped mock testable: it's the only way
to reach the object a call returned — e.g. the channel handed back by
window.createOutputChannel — so assertions can be made against it.
'incomplete' is part of the union because both runners use it for a call
that is still in flight; narrow on type === 'return' before trusting
value.
Clears recorded calls/results/instances without touching the implementation.
Makes every future call return a promise rejected with reason.
Makes the next call only return a promise rejected with reason.
Sets the value resolved (via Promise.resolve) on every future call.
The subset of
vi.fn()/jest.fn()'s returned mock function that this kit relies on: callable, and chainable with the handful ofmock*helpers actually used to build thevscodemock. Both Vitest'sMock<T>and Jest'sjest.Mock<T>satisfy this structurally, so novitest/jesttype import is ever required here. This interface is a portability boundary, not an attempt to expose every runner-specific spy assertion/helper.