You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createHydratedMock<{bar?: string}>() as Required<{bar?: string}
This should prevent you casting to any.
In response of what it should return createHydratedMock.
Required would be slightly incorrect because it doesn't consider nested properties in the object, just the first level.
The purpose of ts-auto-mock was not changing the original type but mutating values. I understand where you are coming from and it something that we could have discuss further if we were actively maintaining the library!!
Subject of the issue
createHydratedMock() mocks optional properties. The typescript compiler should know about that to avoid having to write unnecessary
as any
in tests.Your environment
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: