phillip-le / phillip-le.github.io

https://phillip-le.github.io/
1 stars 0 forks source link

Use satisfies for Partial objects in tests #119

Closed phillip-le closed 2 months ago

phillip-le commented 2 months ago

Satisfies lets you use Partial, tells you when there are unrecognised keys and lets you override mocks

EDIT: ok it doesn't work because satisfies will reduce the typing to Mock<Procedure> instead of what it pretends to be

Maybe satisfies Partial<> as Full would work? Need to check that it still bans unknown keys

what about when you aren’t using vi.fn() e.g. just generating mock data?