vi.mocked()
with partial: true
does the opposite of what's intended?
#6781
Labels
vi.mocked()
with partial: true
does the opposite of what's intended?
#6781
Describe the bug
I'm new to vitest/mocking in general, so please tell me if I'm misunderstanding the use case here.
To my understanding, this code should compile.
From the original issue (#1739), the purpose of
partial: true
seems to be to allow defining only a few properties without typescript complaining.But from what I can tell (simplifying the actual types somewhat), this function accepts the type
T
, and returnsPartial<T>
, where it should instead accept aPartial<T>
and returnT
.Am I simply misunderstanding this? (If so, it may be worth explaining these options better in the docs.)
Reproduction
N/A
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: